当安装CentOS 6.8虚拟机服务器时,会通过DHCP为安装的服务器自动分配动态IP地址。首先查看通过DHCP为服务器分配的动态IP地址。
- [root@binghe150 ~]# ifconfig
- eth0 Link encap:Ethernet HWaddr 00:0C:29:EF:62:B7
- inet addr:192.168.175.151 Bcast:192.168.175.255 Mask:255.255.255.0
- inet6 addr: fe80::20c:29ff:feef:62b7/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:37571 errors:0 dropped:0 overruns:0 frame:0
- TX packets:17914 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:44351409 (42.2 MiB) TX bytes:1582619 (1.5 MiB)
- 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:65536 Metric:1
- RX packets:0 errors:0 dropped:0 overruns:0 frame:0
- TX packets:0 errors:0 dropped:0 overruns:0 carri