rhel Linux 網路配置

j04212發表於2014-02-12


--網路配置

vi /etc/sysconfig/network-scripts/ifcfg-eth0

1)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 localhost6

192.168.0.22    serv22


--網路管理命令

/etc/init.d/network start|stop|restart


--檢視ip命令
ifconfig

--檢視閘道器命令
route -n

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27633655/viewspace-1080024/,如需轉載,請註明出處,否則將追究法律責任。

相關文章