本文发表在 rolia.net 枫下论坛PC1:
eth0 Link encap:Ethernet HWaddr 00:04:9F:00:81:A9
inet addr:10.0.0.109 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23842 errors:12 dropped:0 overruns:0 frame:12
TX packets:294 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1793608 (1.7 Mb) TX bytes:17960 (17.5 Kb)
eth0.5 Link encap:Ethernet HWaddr 00:04:9F:00:81:A9
inet addr:192.168.154.11 Bcast:192.168.154.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:29 errors:0 dropped:0 overruns:0 frame:0
TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2682 (2.6 Kb) TX bytes:3602 (3.5 Kb)
eth1 Link encap:Ethernet HWaddr 00:04:9F:00:81:AA
inet addr:10.0.0.112 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16906 errors:13 dropped:0 overruns:0 frame:13
TX packets:170 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1269704 (1.2 Mb) TX bytes:8452 (8.2 Kb)
Base address:0x4000
PC2:
eth0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:10.0.0.108 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:898399 errors:0 dropped:0 overruns:0 frame:0
TX packets:430032 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:262169242 (250.0 Mb) TX bytes:376485011 (359.0 Mb)
Interrupt:252 Base address:0x8000
eth0.5 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.154.22 Bcast:192.168.153.255 Mask:255.255.255.0
inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1586 (1.5 Kb) TX bytes:10871 (10.6 Kb)
eth0:0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.154.2 Bcast:192.168.154.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
Interrupt:252 Base address:0x8000
eth0:1 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
Interrupt:252 Base address:0x8000
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:6531 errors:0 dropped:0 overruns:0 frame:0
TX packets:6531 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:547752 (534.9 Kb) TX bytes:547752 (534.9 Kb)
以上配置时从PC1 PING PC2 正常
/ # ping 192.168.154.2
PING 192.168.154.2 (192.168.154.2): 56 data bytes
84 bytes from 192.168.154.2: icmp_seq=0 ttl=64 time=10.0 ms
84 bytes from 192.168.154.2: icmp_seq=1 ttl=64 time=0.0 ms
84 bytes from 192.168.154.2: icmp_seq=2 ttl=64 time=0.0 ms
84 bytes from 192.168.154.2: icmp_seq=3 ttl=64 time=0.0 ms
84 bytes from 192.168.154.2: icmp_seq=4 ttl=64 time=0.0 ms
84 bytes from 192.168.154.2: icmp_seq=5 ttl=64 time=0.0 ms
PC1 配置不变,改变PC2 VLAN ID 5 的配置 。
#ifconfig eth0.5 192.168.153.22
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:10.0.0.108 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:898399 errors:0 dropped:0 overruns:0 frame:0
TX packets:430032 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:262169242 (250.0 Mb) TX bytes:376485011 (359.0 Mb)
Interrupt:252 Base address:0x8000
eth0.5 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.153.22 Bcast:192.168.153.255 Mask:255.255.255.0
inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1586 (1.5 Kb) TX bytes:10871 (10.6 Kb)
eth0:0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.154.2 Bcast:192.168.154.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
Interrupt:252 Base address:0x8000
eth0:1 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
Interrupt:252 Base address:0x8000
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:6531 errors:0 dropped:0 overruns:0 frame:0
TX packets:6531 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:547752 (534.9 Kb) TX bytes:547752 (534.9 Kb)
再从PC1 PING PC2 为什么没有回应?
/ # ping 192.168.154.2
PING 192.168.154.2 (192.168.154.2): 56 data bytes
--- 192.168.154.2 ping statistics ---
10 packets transmitted, 0 packets received, 100% packet loss更多精彩文章及讨论,请光临枫下论坛 rolia.net
eth0 Link encap:Ethernet HWaddr 00:04:9F:00:81:A9
inet addr:10.0.0.109 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23842 errors:12 dropped:0 overruns:0 frame:12
TX packets:294 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1793608 (1.7 Mb) TX bytes:17960 (17.5 Kb)
eth0.5 Link encap:Ethernet HWaddr 00:04:9F:00:81:A9
inet addr:192.168.154.11 Bcast:192.168.154.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:29 errors:0 dropped:0 overruns:0 frame:0
TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2682 (2.6 Kb) TX bytes:3602 (3.5 Kb)
eth1 Link encap:Ethernet HWaddr 00:04:9F:00:81:AA
inet addr:10.0.0.112 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16906 errors:13 dropped:0 overruns:0 frame:13
TX packets:170 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1269704 (1.2 Mb) TX bytes:8452 (8.2 Kb)
Base address:0x4000
PC2:
eth0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:10.0.0.108 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:898399 errors:0 dropped:0 overruns:0 frame:0
TX packets:430032 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:262169242 (250.0 Mb) TX bytes:376485011 (359.0 Mb)
Interrupt:252 Base address:0x8000
eth0.5 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.154.22 Bcast:192.168.153.255 Mask:255.255.255.0
inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1586 (1.5 Kb) TX bytes:10871 (10.6 Kb)
eth0:0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.154.2 Bcast:192.168.154.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
Interrupt:252 Base address:0x8000
eth0:1 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
Interrupt:252 Base address:0x8000
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:6531 errors:0 dropped:0 overruns:0 frame:0
TX packets:6531 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:547752 (534.9 Kb) TX bytes:547752 (534.9 Kb)
以上配置时从PC1 PING PC2 正常
/ # ping 192.168.154.2
PING 192.168.154.2 (192.168.154.2): 56 data bytes
84 bytes from 192.168.154.2: icmp_seq=0 ttl=64 time=10.0 ms
84 bytes from 192.168.154.2: icmp_seq=1 ttl=64 time=0.0 ms
84 bytes from 192.168.154.2: icmp_seq=2 ttl=64 time=0.0 ms
84 bytes from 192.168.154.2: icmp_seq=3 ttl=64 time=0.0 ms
84 bytes from 192.168.154.2: icmp_seq=4 ttl=64 time=0.0 ms
84 bytes from 192.168.154.2: icmp_seq=5 ttl=64 time=0.0 ms
PC1 配置不变,改变PC2 VLAN ID 5 的配置 。
#ifconfig eth0.5 192.168.153.22
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:10.0.0.108 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:898399 errors:0 dropped:0 overruns:0 frame:0
TX packets:430032 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:262169242 (250.0 Mb) TX bytes:376485011 (359.0 Mb)
Interrupt:252 Base address:0x8000
eth0.5 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.153.22 Bcast:192.168.153.255 Mask:255.255.255.0
inet6 addr: fe80::221:9bff:fe1f:25ae/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1586 (1.5 Kb) TX bytes:10871 (10.6 Kb)
eth0:0 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.154.2 Bcast:192.168.154.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
Interrupt:252 Base address:0x8000
eth0:1 Link encap:Ethernet HWaddr 00:21:9B:1F:25:AE
inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
Interrupt:252 Base address:0x8000
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:6531 errors:0 dropped:0 overruns:0 frame:0
TX packets:6531 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:547752 (534.9 Kb) TX bytes:547752 (534.9 Kb)
再从PC1 PING PC2 为什么没有回应?
/ # ping 192.168.154.2
PING 192.168.154.2 (192.168.154.2): 56 data bytes
--- 192.168.154.2 ping statistics ---
10 packets transmitted, 0 packets received, 100% packet loss更多精彩文章及讨论,请光临枫下论坛 rolia.net