悲剧,绝对的悲剧,悲剧中的悲剧。
分类: 系统运维
2011-02-24 18:09:16
[root@machome macg]# /etc/init.d/network status Configured devices: lo eth0 Currently active devices: lo eth0 |
[root@localhost /]# ls /etc/sysconfig/network-scripts/ ifcfg-eth0 ifcfg-lo ifdown ifdown-aliases ifdown-bnep |
[root@localhost network-scripts]# more ifcfg-eth0 DEVICE=eth0 BOOTPROTO=static BROADCAST=192.168.1.255 HWADDR=00:90:27:10:D7:50 IPADDR=192.168.1.12 NETMASK=255.255.255.0 NETWORK=192.168.1.0 ONBOOT=yes TYPE=Ethernet |
[root@localhost network-scripts]# more ifcfg-lo DEVICE=lo IPADDR=127.0.0.1 NETMASK=255.0.0.0 NETWORK=127.0.0.0 # If you're having problems with gated making 127.0.0.0/8 a martian, # you can change this to something else (255.255.255.255, for example) BROADCAST=127.255.255.255 ONBOOT=yes NAME=loopback |
改完后,重起network service /etc/init.d/network restart |
[root@ntracker /]# cat
/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=static BROADCAST=10.4.255.255 HWADDR=00:15:17:2C:60:87 IPADDR=10.4.3.55 |
[root@ntracker /]# cat
/etc/sysconfig/network-scripts/ifcfg-eth0:1 DEVICE=eth0 BOOTPROTO=static BROADCAST=10.4.255.255 HWADDR=00:15:17:2C:60:87 IPADDR=10.4.3.55 |
[root@ntracker /]# cat
/etc/sysconfig/network-scripts/ifcfg-eth0:1 DEVICE=eth0:1 |
[root@localhost network-scripts]# more ifcfg-eth0 TYPE="Ethernet" BOOTPROTO="static" IPADDR="0.0.0.0" DEVICE="lan" ONBOOT="yes" |
[root@localhost network-scripts]# more ifcfg-eth1 TYPE="Ethernet" BOOTPROTO="static" IPADDR="10.70.10.11" DEVICE="wan" HWADDR="00:0C:29:33:69:90" |
ipaddr=10.4.2.110 netmask=255.255.0.0 |
IPADDR=10.4.2.110 NETMASK=255.255.0. 0 |
|
ifconfig
可以看到新网卡eth1 [root@demo1 linux4]# /sbin/ifconfig -a eth0 eth0:1 eth1 |
但/etc/sysconfig/network-scripts/下没有ifcfg-eth1 [root@demo1 network-scripts]# ls ifcfg-eth0 |
手工加ifcfg-eth1 [root@demo1 network-scripts]# vi ifcfg-eth1 DEVICE=eth1 BOOTPROTO=static BROADCAST=192.168.1.255 HWADDR=00:E0:4C:85:DB:D5 IPADDR=192.168.1.12 NETMASK=255.255.255.0 NETWORK=192.168.1.0 ONBOOT=yes TYPE=Ethernet |
[root@demo1 network-scripts]#
/etc/init.d/network restart Shutting down interface eth0: Shutting down interface eth1: Shutting down loopback interface: Setting network parameters: Bringing up loopback interface: Bringing up interface eth0: Bringing up interface eth1: |
然后另连一台机器到eth1,能ping通 |
[root@localhost macg]# cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=localhost.localdomain GATEWAY=192.168.1.1 |
chinaunix网友2011-03-06 17:23:52
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com
chinaunix网友2011-03-06 17:23:52
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com