IP配置
[root@eegooserver3 ~]# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
/etc/sysconfig/network-scripts/ifcfg-em1原始配置
[root@eegooserver3 ~]# vi /opt/network-scripts/ifcfg-em1
DEVICE="em1"
BOOTPROTO="dhcp"
HWADDR="D4:BE:D9:AF:ED:B1"
NM_CONTROLLED="yes"
ONBOOT="no"
TYPE="Ethernet"
UUID="2864b3f3-0a34-4c48-b3a2-a49df5f1a14d"
~
~
~
[root@eegooserver3 ~]# vi /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE="em1"
BOOTPROTO="static"
HWADDR="D4:BE:D9:AF:ED:B1"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR="172.16.19.9"
NETMASK="255.255.0.0"
GATEWAY="172.16.19.254"
TYPE="Ethernet"
UUID="2864b3f3-0a34-4c48-b3a2-a49df5f1a14d"
~
~
~
[root@eegooserver3 ~]# vi /etc/resolv.conf
nameserver 202.96.134.133
~
~
~
[root@eegooserver3 ~]# service network restart
[root@eegooserver3 ~]# ifconfig
em1 Link encap:Ethernet HWaddr D4:BE:D9:AF:ED:B1
inet addr:172.16.19.9 Bcast:172.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::d6be:d9ff:feaf:edb1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:328383 errors:0 dropped:0 overruns:0 frame:0
TX packets:54313 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:157202709 (149.9 MiB) TX bytes:4409391 (4.2 MiB)
Interrupt:36 Memory:d6000000-d6012800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@eegooserver3 ~]# ping 172.16.19.6
PING 172.16.19.6 (172.16.19.6) 56(84) bytes of data.
64 bytes from 172.16.19.6: icmp_seq=1 ttl=64 time=0.685 ms
64 bytes from 172.16.19.6: icmp_seq=2 ttl=64 time=0.180 ms
64 bytes from 172.16.19.6: icmp_seq=3 ttl=64 time=0.179 ms
^C
--- 172.16.19.6 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2723ms
rtt min/avg/max/mdev = 0.179/0.348/0.685/0.238 ms
[root@eegooserver3 ~]# ping www.baidu.com
PING www.a.shifen.com (220.181.112.143) 56(84) bytes of data.
64 bytes from 220.181.112.143: icmp_seq=1 ttl=54 time=36.5 ms
64 bytes from 220.181.112.143: icmp_seq=2 ttl=54 time=36.2 ms
64 bytes from 220.181.112.143: icmp_seq=3 ttl=54 time=36.4 ms
^C
--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2686ms
rtt min/avg/max/mdev = 36.277/36.419/36.538/0.189 ms
[root@eegooserver3 ~]#