CentOS中所有的设备都是文件.网卡也在文件中定义.
IP的绑定也只需要更改文件.
网卡相关文件在目录: /etc/sysconfig/network-scripts
查询当前IP信息:
ifconfig:
eth0 Link encap:Ethernet HWaddr 00:50:56:AC:6B:0F
inet addr:42.51.135.206 Bcast:42.51.135.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fead:6b0f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:374772 errors:0 dropped:0 overruns:0 frame:0
TX packets:35165 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:28759089 (27.4 MiB) TX bytes:4779278 (4.5 MiB)
在当前目录下有文件:
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
重启网卡:
service network restart
这时候再查看IP:
eth0 Link encap:Ethernet HWaddr 00:50:56:AC:6B:0F
inet addr:42.51.135.206 Bcast:42.51.135.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fead:6b0f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:384344 errors:0 dropped:0 overruns:0 frame:0
TX packets:35241 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:29462159 (28.0 MiB) TX bytes:4791402 (4.5 MiB)
eth0:1 Link encap:Ethernet HWaddr 00:50:56:AC:6B:0F
inet addr:42.51.138.1 Bcast:42.51.138.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:2 Link encap:Ethernet HWaddr 00:50:56:AC:6B:0F
inet addr:42.51.138.2 Bcast:42.51.138.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:3 Link encap:Ethernet HWaddr 00:50:56:AC:6B:0F
inet addr:42.51.138.3 Bcast:42.51.138.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
测试:
在其它机器上分别 ping 上面几个IP.
服装店经营模拟游戏 汉化版v0.1
服装店经营模拟游戏是一款玩法简单有趣的3D类型模拟经营游戏,
从细胞到奇点 最新版本v32.42
从细胞到奇点官方正版是一款科学放置游戏,在游戏中玩家需要点击
MY LITTLE PONY魔法公主 安卓版v10.0.0
MY LITTLE PONY魔法公主是一款卡通风格的模拟养成
星露谷物语sve 安卓版v1.5.6.52
星露谷物语sve手机版是游戏的超大拓展Mod内容,全称Sta
动物园大亨 手机版v2.0
动物园大亨是一款模拟动物园经营的休闲放置游戏,采用了卡通画风