网卡配置文件存放位置
redhat : /etc/syscofig/netowork-scriptsifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:22:46:02:89:3C
ONBOOT=yes
IPADDR=192.168.1.110
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
设置DNS echo ‘nameserver’> /etc/resolv.conf
重启:/etc/init.d/network restart 即可
Ubuntu:
静态IP需要手动设置,设置方法是:
sudo vi /etc/network/interfaces :
auto eth0
# iface eth0 inet dhcp
iface eht0 inet static
address 192.168.1.254
netmask 255.255.255.0
gateway 192.168.1.1
nameserver 192.168.1.1
sudo /etc/init.d/networking restart