登录站点

用户名

密码

二层网络中相同vlan下的不同地址通信

1已有 2042 次阅读  2013-02-22 15:39   标签二层网络  相同vlan  不同地址 

SW1:

no ip routing
!
no spanning-tree vlan 10
!      
interface FastEthernet0/0
 switchport trunk native vlan 10
 switchport mode trunk
!
interface FastEthernet0/1
 switchport access vlan 10
!
SW1#sh cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater
Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
PC1.lab.local    Fas 0/1            141         S I       3640      Fas 0/1
SW2.lab.local    Fas 0/0            160        R S I      3640      Fas 0/0
SW1#sh vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15
10   VLAN0010                         active    Fa0/1
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        1002   1003
10   enet  100010     1500  -      -      -        -    -        0      0  
1002 fddi  101002     1500  -      -      -        -    -        1      1003
1003 tr    101003     1500  1005   0      -        -    srb      1      1002
1004 fdnet 101004     1500  -      -      1        ibm  -        0      0  
1005 trnet 101005     1500  -      -      1        ibm  -        0      0  
SW1#
SW2:
no ip routing
!
no spanning-tree vlan 10
!       
interface FastEthernet0/0
 switchport trunk native vlan 10
 switchport mode trunk
!
interface FastEthernet0/1
 switchport access vlan 10
!
SW2#sh cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater
Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
PC2.lab.local    Fas 0/1            148         S I       3640      Fas 0/1
SW1.lab.local    Fas 0/0            127        R S I      3640      Fas 0/0
SW2#sh vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15
10   VLAN0010                         active    Fa0/1
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        1002   1003
10   enet  100010     1500  -      -      -        -    -        0      0  
1002 fddi  101002     1500  -      -      -        -    -        1      1003
1003 tr    101003     1500  1005   0      -        -    srb      1      1002
1004 fdnet 101004     1500  -      -      1        ibm  -        0      0  
1005 trnet 101005     1500  -      -      1        ibm  -        0      0  
SW2#
PC1:
no ip routing
!
interface FastEthernet0/1
 no switchport
 ip address 192.168.10.1 255.255.255.0
!
PC1#ping 172.16.20.1 so 192.168.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.10.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/44/80 ms
PC2:
no ip routing
!
interface FastEthernet0/1
 no switchport
 ip address 172.16.20.1 255.255.255.0
!
PC2#ping 192.168.10.1 so 172.16.20.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
Packet sent with a source address of 172.16.20.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/35/68 ms

PS:在二层网络中,可以实现相同vlan下不同IP地址之间相互通信。

分享 举报

发表评论 评论 (1 个评论)

涂鸦板