rhel Linux 网络配置

--网络配置vi /etc/sysconfig/network-scripts/ifcfg-eth01)DHCP
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

2)静态IP                         
DEVICE=eth0                  
BOOTPROTO=none               
IPADDR=192.168.0.22          
NETMASK=255.255.255.0
GATEWAY=192.168.0.254
DNS1=192.168.0.254
ONBOOT=yes

vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=serv22
GATEWAY=192.168.0.254

vi /etc/resolv.conf
nameserver 192.168.0.254

vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       serv22 localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6192.168.0.22    serv22
--网络管理命令
/etc/init.d/network start|stop|restart
--查看ip命令
ifconfig

--查看网关命令
route -n

相关内容推荐