计划
#获取可使用的IP段落
cat /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf | grep range
结果:range 172.16.160.128 172.16.160.254;
cat /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf | grep netmask
结果:subnet 172.16.160.0 netmask 255.255.255.0 {
#获取网关
cat /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf | grep 'option routers'
结果: option routers 172.16.160.2;
#获取广播地址
cat /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf | grep broad
结果:option broadcast-address 172.16.160.255;
计划IP:172.16.160.133
子网掩码:255.255.255.0
网关:172.16.160.2
DNS:223.5.5.5
配置前状况
[bigdata@bigdata ~]$ su - root
Password:
[root@bigdata ~]
eth0 Link encap:Ethernet HWaddr 00:50:56:20:A0:E9
inet6 addr: fe80::250:56ff:fe20:a0e9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:17910 (17.4 KiB)
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:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:480 (480.0 b) TX bytes:480 (480.0 b)
[root@bigdata ~]
/etc/sysconfig/network-scripts/ifcfg-eth0
配置
vim /etc/sysconfig/network-scripts/ifcfg-eth0
改前:BOOTPROTO=dhcp
改后:BOOTPROTO=none
IPADDR=172.16.160.133
GATEWAY=172.16.160.2
DNS1=223.5.5.5
网卡在启动
ifdown eth0;ifup eth0
配置后状况
[root@bigdata ~]
eth0 Link encap:Ethernet HWaddr 00:50:56:20:A0:E9
inet addr:172.16.160.133 Bcast:172.16.160.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe20:a0e9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:146 errors:0 dropped:0 overruns:0 frame:0
TX packets:262 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:56065 (54.7 KiB) TX bytes:50007 (48.8 KiB)
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:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:11856 (11.5 KiB) TX bytes:11856 (11.5 KiB)
[root@bigdata ~]