关于单臂路由的问题

来源:百度知道 编辑:UC知道 时间:2024/05/29 10:39:27
一个路由连交换机,交换机连两PC。
Router:
en
conf t
int f0/0
no ip address
no shut down
exit
int f0/0.1
encapsulation dot1Q 1
ip add 192.168.10.1 255.255.255.0
ex
int f0/0.2
encapsulation dot1Q 2
ip add 192.168.20.1 255.255.255.0
switch:
en
conf t
int f0/0
switchport mode trunk
ex
int f1/0
switchport accesss vlan 1
ex
int f2/0
switchport accesss vlan 2
为什么交换机的两个VLan间的主机不能通信。小弟无知,请帮忙给正确补充谢谢
在啊

问题出在配置单臂路由时没有考虑到本地VLAN的帧:
在交换机上有两个VLAN:VLAN1和VLAN2,其中VLAN1如果没做修改的话,默认为本地VLAN。在802.1Q中,本地VLAN的帧不会被标记,因此对位于本地VLAN中的子接口,需要配置命令encapsulation dot1Q 1 native
相关命令:
Router:
en
conf t
int f0/0
no ip address
no shut down
exit
int f0/0.1
encapsulation dot1Q 1 native
ip add 192.168.10.1 255.255.255.0
no sh(进入子接口,就自动开启,但最好打上此命令)
ex
int f0/0.2
encapsulation dot1Q 2
ip add 192.168.20.1 255.255.255.0
no sh

int f0/0.1
encapsulation dot1Q 1
ip add 192.168.10.1 255.255.255.0
这个用不用no shut
忘了!
咳咳!看看连线错没?

各主机设置一个网关

PC的网关是在路由器上么