我使用RedHat9的系統
有兩塊網路卡:eth0和eth1,但是eth1並沒有啟動它,所以真正在工作的只有eth0
,並且我在eth0上面綁了兩個IP
底下是檔案的內容:
/etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.1.11.1
NETWORK=10.1.11.0
NETMASK=255.255.255.0
BROADCAST=10.1.11.255
#GATEWAY=10.1.11.1
/etc/sysconfig/network-scripts/ifcfg-eth0:0
BOOTPROTO=static
ONBOOT=no
IPADDR=10.1.12.1
NETWORK=10.1.12.0
NETMASK=255.255.255.0
BROADCAST=10.1.12.255
#GATEWAY=10.1.11.1
==============================================================================
在文字模式下使用route指令時卻多跑出一個BClass的網域
#route
Destination Gateway Genmask Flages Metric Ref Use Iface
59-117-12-254 * 255.255.255.255 UH 0 0 0 ppp0
10.1.12.0 * 255.255.255.0 U 0 0 0 eth0
10.1.11.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 59-117-112-254 0.0.0.0 UG 0 0 0 ppp0
============================================================================
#route del -net 169.254.0.0 netmask 255.255.0.0 dev eth0
Destination Gateway Genmask Flages Metric Ref Use Iface
59-117-12-254 * 255.255.255.255 UH 0 0 0 ppp0
10.1.12.0 * 255.255.255.0 U 0 0 0 eth0
10.1.11.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 59-117-112-254 0.0.0.0 UG 0 0 0 ppp0
這應該正常,因為已經刪除該route
但是/etc/rc.d/init.d/network restart之後
==============================================================================
Destination Gateway Genmask Flages Metric Ref Use Iface
59-117-12-254 * 255.255.255.255 UH 0 0 0 ppp0
10.1.12.0 * 255.255.255.0 U 0 0 0 eth0
10.1.11.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 59-117-112-254 0.0.0.0 UG 0 0 0 ppp0
又跑出來了= =,怎麼會這樣,是我哪裡沒有設定好嗎?
真的很困擾....
--
有兩塊網路卡:eth0和eth1,但是eth1並沒有啟動它,所以真正在工作的只有eth0
,並且我在eth0上面綁了兩個IP
底下是檔案的內容:
/etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.1.11.1
NETWORK=10.1.11.0
NETMASK=255.255.255.0
BROADCAST=10.1.11.255
#GATEWAY=10.1.11.1
/etc/sysconfig/network-scripts/ifcfg-eth0:0
BOOTPROTO=static
ONBOOT=no
IPADDR=10.1.12.1
NETWORK=10.1.12.0
NETMASK=255.255.255.0
BROADCAST=10.1.12.255
#GATEWAY=10.1.11.1
==============================================================================
在文字模式下使用route指令時卻多跑出一個BClass的網域
#route
Destination Gateway Genmask Flages Metric Ref Use Iface
59-117-12-254 * 255.255.255.255 UH 0 0 0 ppp0
10.1.12.0 * 255.255.255.0 U 0 0 0 eth0
10.1.11.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 59-117-112-254 0.0.0.0 UG 0 0 0 ppp0
============================================================================
#route del -net 169.254.0.0 netmask 255.255.0.0 dev eth0
Destination Gateway Genmask Flages Metric Ref Use Iface
59-117-12-254 * 255.255.255.255 UH 0 0 0 ppp0
10.1.12.0 * 255.255.255.0 U 0 0 0 eth0
10.1.11.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 59-117-112-254 0.0.0.0 UG 0 0 0 ppp0
這應該正常,因為已經刪除該route
但是/etc/rc.d/init.d/network restart之後
==============================================================================
Destination Gateway Genmask Flages Metric Ref Use Iface
59-117-12-254 * 255.255.255.255 UH 0 0 0 ppp0
10.1.12.0 * 255.255.255.0 U 0 0 0 eth0
10.1.11.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 59-117-112-254 0.0.0.0 UG 0 0 0 ppp0
又跑出來了= =,怎麼會這樣,是我哪裡沒有設定好嗎?
真的很困擾....
--
All Comments