1、设置IP:
#im /etc/sysconfig/network-scripts/ifcfg-eth0:
#im /etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.10
NETMASK=255.255.255.0
HWADDR=52:54:AB:2F:CF:F0
GATEWAY=192.168.1.1
ONBOOT=on
TYPE=Ethernet
2、设置网关:
3、重启网络:
#sudo /etc/init.d/network restart
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.10
NETMASK=255.255.255.0
HWADDR=52:54:AB:2F:CF:F0
GATEWAY=192.168.1.1
ONBOOT=on
TYPE=Ethernet
2、设置网关:
#/etc/resolv.conf
nameserver 202.103.24.68
nameserver 202.103.44.150
或者直接设置为网关:
nameserver 192.168.1.1
#search localdomain
nameserver 202.103.44.150
或者直接设置为网关:
nameserver 192.168.1.1
#search localdomain
3、重启网络:
#sudo /etc/init.d/network restart
本文详细介绍如何在Linux系统中手动设置静态IP地址、配置网关及DNS,并提供了重启网络服务的具体命令。
5157

被折叠的 条评论
为什么被折叠?



