|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
欢迎大家来到仓酷云论坛!CentOS中一切的装备都是文件.网卡也在文件中界说.IP的绑定也只必要变动文件.
网卡相干文件在目次:/etc/sysconfig/network-scripts
查询以后IP信息:
ifconfig:
eth0Linkencap:EthernetHWaddr00:50:56:AC:6B:0F
inetaddr:42.51.135.206Bcast:42.51.135.255Mask:255.255.255.0
inet6addr:fe80::250:56ff:fead:6b0f/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:374772errors:0dropped:0overruns:0frame:0
TXpackets:35165errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:28759089(27.4MiB)TXbytes:4779278(4.5MiB)
在以后目次下有文件:
ifcfg-eth0
在目次下新建文件:
ifcfg-eth0:1
内容以下:
DEVICE=eth0:1
IPADDR=42.51.138.1
NETMASK=255.255.255.0
HWADDR=00:50:56:AC:6B:0F
NM_CONTROLLED=yes
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
ifcfg-eth0:2
DEVICE=eth0:2
IPADDR=42.51.138.2
NETMASK=255.255.255.0
HWADDR=00:50:56:AC:6B:0F
NM_CONTROLLED=yes
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
ifcfg-eth0:3
DEVICE=eth0:3
IPADDR=42.51.138.3
NETMASK=255.255.255.0
HWADDR=00:50:56:AC:6B:0F
NM_CONTROLLED=yes
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
重启网卡:
servicenetworkrestart
这时候候再检察IP:
eth0Linkencap:EthernetHWaddr00:50:56:AC:6B:0F
inetaddr:42.51.135.206Bcast:42.51.135.255Mask:255.255.255.0
inet6addr:fe80::250:56ff:fead:6b0f/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:384344errors:0dropped:0overruns:0frame:0
TXpackets:35241errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:29462159(28.0MiB)TXbytes:4791402(4.5MiB)
eth0:1Linkencap:EthernetHWaddr00:50:56:AC:6B:0F
inetaddr:42.51.138.1Bcast:42.51.138.255Mask:255.255.255.0
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
eth0:2Linkencap:EthernetHWaddr00:50:56:AC:6B:0F
inetaddr:42.51.138.2Bcast:42.51.138.255Mask:255.255.255.0
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
eth0:3Linkencap:EthernetHWaddr00:50:56:AC:6B:0F
inetaddr:42.51.138.3Bcast:42.51.138.255Mask:255.255.255.0
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
测试:
在别的呆板上分离ping下面几个IP.
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|