Networking
Configuring hostname
/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=lin1
GATEWAY=10.10.10.1
Hostname also stored in /etc/hosts
Configuring IP address for static IP address
/etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
10.10.10.100 lin1.dns.net lin1
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.10.10.100
ONBOOT=yes
Configuring IP address for DHCP
/etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 lin1.dns.net lin1 localhost.localdomain localhost
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
Setting Speed/Duplex on NIC
This can be done a number of ways including
Use /sbin/mii-tool (part of net-tools package). An example of usage :
/sbin/mii-tool -F 100baseTx-FD eth0
or use ethtool
/usr/sbin/ethtool -s eth0 speed 100 duplex full
With some ethernet cards sometimes you get the following error with ethtool:
Cannot get current device settings: Operation not supported
not setting speed
not setting duplex
in which case use mii-tool as mentioned above