如何實(shí)現(xiàn)同一路由器不同vlan之間的通信
本文是小編帶來如何實(shí)現(xiàn)同一路由器不同vlan之間的通信,歡迎大家閱讀。
VLAN(Virtual Local Area Network)的中文名為"虛擬局域網(wǎng)"。VLAN是一種將局域網(wǎng)設(shè)備從邏輯上劃分成一個(gè)個(gè)網(wǎng)段,從而實(shí)現(xiàn)虛擬工作組的新興數(shù)據(jù)交換技術(shù)。
第一步,看拓?fù)鋱D。
先把pc上的ip都配好。開始設(shè)置
switch0:
>en
>conf t
>vlan 2
>exit
>int fa 0/1
>switchport access vlan 2
>exit
>int fa 0/2
>switchport access vlan 2
>exit
>int fa 0/3
>switchport mode trunk
>end
switch1:
>en
>conf t
>vlan 3
>exit
>int fa 0/1
>switchport access vlan 3
>exit
>int fa 0/2
>switchport access vlan 3
>exit
>int fa 0/3
>switchport mode trunk
>end
Router0:
>enable
>configure terminal
>interface fastEthernet 0/0
>no ip adderss //清除ip
>no shutsown
>exit
>interface fastEthernet 0/0.1 //子接口設(shè)置
>encapsulation dot1Q 2 //封裝協(xié)議 連到vlan 2
>ip address 192.168.0.1 255.255.255.0
>exit
>interface fastEthernet 0/1
>no ip adderss //清除ip
>no shutsown
>exit
>interface fastEthernet 0/1.1 //子接口設(shè)置
>encapsulation dot1Q 3 //封裝協(xié)議 連到vlan 3
>ip address 192.168.1.1 255.255.255.0
>end
pc0 CMD:
ping PC1
ping PC 3