同一路由器不同vlan之间的通信

网络 路由交换
VLAN(Virtual Local Area Network)的中文名为"虚拟局域网"。VLAN是一种将局域网设备从逻辑上划分成一个个网段,从而实现虚拟工作组的新兴数据交换技术。

***步,看拓扑图。

 

先把pc上的ip都配好。开始设置

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 //子接口设置

>encapsulation dot1Q 2 //封装协议 连到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 //子接口设置

>encapsulation dot1Q 3 //封装协议 连到vlan 3

>ip address 192.168.1.1 255.255.255.0

>end

 

 

 

pc0 CMD:

ping PC1

 

 

ping PC 3

 

责任编辑:林琳 来源: 网络通信
相关推荐

2013-10-22 10:33:31

2020-03-31 08:36:11

WiFi 6路由器5G

2009-02-18 14:52:55

路由产品实达模块化

2010-08-10 11:01:23

路由器功能

2010-09-16 14:30:58

2600路由器PPPo

2010-05-31 17:16:53

IPv6路由器

2011-07-21 10:44:35

Cisco2620路由器

2010-06-02 15:04:43

IPv6路由器

2010-08-19 13:20:44

路由器

2011-09-09 10:14:10

192.168.1.1192.168.1.1

2009-12-15 14:13:45

水星mr808路由器

2009-12-02 19:11:40

Cisco 2500路

2011-09-06 15:48:42

水星路由器设置水星MR-804路由器路由器

2009-11-23 14:51:29

IPv6路由器

2011-09-08 13:21:40

2011-09-08 13:22:08

路由器Dlink路由器设置

2009-11-27 16:49:00

Cisco 2500路

2009-12-14 18:02:21

2011-09-06 10:36:47

2009-12-03 10:36:21

CISCO 3845路
点赞
收藏

51CTO技术栈公众号