[問題] 單網卡 多IP (已解決)
你好!我有一個問題
在/etc/sysconfig/network-scripts目錄裡
cp ifcfg-eth0 ifcfg-eth0:1
-------------------
ifcfg-eth0 檔內容
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:01:02:38:BA:BF
IPADDR=192.168.2.16
NETMASK=255.255.255.0
ONBOOT=yes
-------------------
ifcfg-eth0:1 檔內容
DEVICE=eth0:1
BOOTPROTO=static
HWADDR=00:01:02:38:BA:BF
IPADDR=192.168.2.11
NETMASK=255.255.255.0
ONBOOT=yes
電腦重新開機登入後,鍵入指令 ifconfig
eth0 Link encap:Ethernet HWaddr 00:01:02:38:BA:BF
inet addr:192.168.2.11 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::201:2ff:fe38:babf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:44 errors:0 dropped:0 overruns:1 frame:0
TX packets:98 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5076 (4.9 KiB) TX bytes:15242 (14.8 KiB)
Interrupt:12 Base address:0x4000
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:560 (560.0 b) TX bytes:560 (560.0 b)
為什麼eth0 變成了eth0:1 的192.168.2.11
而不是會有兩個介面
eth0 192.168.2.16
eth0:1 192.168.2.11
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.166.172.151
※ 編輯: oysternoodle 來自: 118.166.172.151 (11/24 16:58)
※ 編輯: oysternoodle 來自: 118.166.172.151 (11/24 16:59)
→
11/24 19:11, , 1F
11/24 19:11, 1F
→
11/24 22:31, , 2F
11/24 22:31, 2F
→
11/24 22:41, , 3F
11/24 22:41, 3F
→
11/24 22:42, , 4F
11/24 22:42, 4F
→
11/26 09:23, , 5F
11/26 09:23, 5F
→
11/26 09:23, , 6F
11/26 09:23, 6F