單網卡 多IP - Linux
By Sierra Rose
at 2009-11-24T16:03
at 2009-11-24T16:03
Table of Contents
你好!我有一個問題
在/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
--
在/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
--
Tags:
Linux
All Comments
By Ethan
at 2009-11-25T21:12
at 2009-11-25T21:12
By Anthony
at 2009-11-30T01:02
at 2009-11-30T01:02
By Sarah
at 2009-12-04T19:41
at 2009-12-04T19:41
By Ursula
at 2009-12-06T04:32
at 2009-12-06T04:32
By Eartha
at 2009-12-07T04:28
at 2009-12-07T04:28
Related Posts
請問套件管理的觀念
By Jessica
at 2009-11-24T15:55
at 2009-11-24T15:55
問一個軟體
By Sarah
at 2009-11-24T15:55
at 2009-11-24T15:55
如何把開機選項找回來
By Lydia
at 2009-11-24T15:10
at 2009-11-24T15:10
Ubuntu9.10苦難記
By Heather
at 2009-11-24T15:06
at 2009-11-24T15:06
Ubuntu 9.10 mplayer相關問題
By Rebecca
at 2009-11-24T13:39
at 2009-11-24T13:39