Linux下设置IP

Linux下

vi   /etc/sysconfig/network-scripts/ifcfg-eth0  
  DEVICE=eth0  
  BOOTPROTO=none  
  HWADDR=00:50:8D:7D:F9:44  
  ONBOOT=yes  
  TYPE=Ethernet  
  NETMASK=255.255.255.0  
  IPADDR=172.16.106.155  
  USERCTL=no  
  PEERDNS=yes  
  GATEWAY=172.16.106.254  
  IPV6INIT=no 

BSD下:

vi /etc/rc.conf

or

ifconfig le0 192.168.0.123/24

route add default 192.168.0.1

DNS设置两个都一样

vi /etc/resolv.conf

nameserver 202.102.224.68

nameserver 202.102.227.68

留下评论