1. 修改 IP address
A. ifconfig eth0 192.168.0.55 netmask 255.255.255.0
B. vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static (or dhcp)
BROADCAST=192.168.0.255
IPADDR=192.168.0.55
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes
查看結果
ifconfig -a eth0
2. 修改 default gateway
A. route add default gw 192.168.0.1
B. vi /etc/sysconfig/network-scripts/ifcfg-eth0
GATEWAY=192.168.0.1
3. 修改 DNS
vi /etc/resolv.conf
search
nameserver 8.8.8.8 (first)
nameserver 8.8.4.4 (second)
4. 重新啟動網路服務
/etc/init.d/network restart
或
ifdown eth0;ifup eth0 (針對網卡停用啟動)
沒有留言:
張貼留言