交换机配置trunk和VLAN后PC可以ping通路由器ping不通

yyyayo 2019-07-06 03:46:49
这是这一部分的拓扑图和对应的IP:


然后从PC0去ping Server0、PC3、Router0的结果如下:

只有Router0连接交换机的这一端ping不通

请教各位大佬这是为什么呀
...全文
2966 18 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
fanjohn 2019-07-18
  • 打赏
  • 举报
回复
引用 17 楼 yanchuandong的回复:
[quote=引用 16 楼 fanjohn的回复:][quote=引用 15 楼 yanchuandong的回复:][quote=引用 14 楼 fanjohn的回复:][quote=引用 13 楼 yanchuandong 的回复:] 路由器上没有路由,添加去往201段的路由即可
Router0中加入一句 ip route-static 192.168.201.0 255.255.255.0 192.168.101.1 第二种就是在Router0中添加ospf router ospf 1 log-adjacency-changes network 192.168.101.0 0.0.0.255 area 0 [/quote] ospf在这里没什么用[/quote] ospf加上后Router0就可以学习到192.168.201.0/24的路由了[/quote] sw1和route接的口是个Access,ospf的包过不来[/quote] ospf是封装在ip包内的,怎么会过不来
ycd(Crayon) 2019-07-17
  • 打赏
  • 举报
回复
引用 16 楼 fanjohn的回复:
[quote=引用 15 楼 yanchuandong的回复:][quote=引用 14 楼 fanjohn的回复:][quote=引用 13 楼 yanchuandong 的回复:] 路由器上没有路由,添加去往201段的路由即可
Router0中加入一句 ip route-static 192.168.201.0 255.255.255.0 192.168.101.1 第二种就是在Router0中添加ospf router ospf 1 log-adjacency-changes network 192.168.101.0 0.0.0.255 area 0 [/quote] ospf在这里没什么用[/quote] ospf加上后Router0就可以学习到192.168.201.0/24的路由了[/quote] sw1和route接的口是个Access,ospf的包过不来
fanjohn 2019-07-17
  • 打赏
  • 举报
回复
引用 15 楼 yanchuandong的回复:
[quote=引用 14 楼 fanjohn的回复:][quote=引用 13 楼 yanchuandong 的回复:] 路由器上没有路由,添加去往201段的路由即可
Router0中加入一句 ip route-static 192.168.201.0 255.255.255.0 192.168.101.1 第二种就是在Router0中添加ospf router ospf 1 log-adjacency-changes network 192.168.101.0 0.0.0.255 area 0 [/quote] ospf在这里没什么用[/quote] ospf加上后Router0就可以学习到192.168.201.0/24的路由了
ycd(Crayon) 2019-07-17
  • 打赏
  • 举报
回复
引用 14 楼 fanjohn的回复:
[quote=引用 13 楼 yanchuandong 的回复:] 路由器上没有路由,添加去往201段的路由即可
Router0中加入一句 ip route-static 192.168.201.0 255.255.255.0 192.168.101.1 第二种就是在Router0中添加ospf router ospf 1 log-adjacency-changes network 192.168.101.0 0.0.0.255 area 0 [/quote] ospf在这里没什么用
fanjohn 2019-07-17
  • 打赏
  • 举报
回复
引用 13 楼 yanchuandong 的回复:
路由器上没有路由,添加去往201段的路由即可
Router0中加入一句 ip route-static 192.168.201.0 255.255.255.0 192.168.101.1 第二种就是在Router0中添加ospf router ospf 1 log-adjacency-changes network 192.168.101.0 0.0.0.255 area 0
ycd(Crayon) 2019-07-15
  • 打赏
  • 举报
回复
路由器上没有路由,添加去往201段的路由即可
qq234419156 2019-07-14
  • 打赏
  • 举报
回复
1.连路由用access口, 2.SW1增加静态路由 0.0.0.0 0.0.0.0 192.168.101.253
qq234419156 2019-07-14
  • 打赏
  • 举报
回复
1.连路由用access口, SW1增加静态路由 0.0.0.0 0.0.0.0 172.16.0.1
AnZer™ 2019-07-13
  • 打赏
  • 举报
回复
两种方法,
1在路由下联口做子接口 分别归属于vlan101和201
删除SW1上的VLAN101 201的接口IP
把接口IP分别配给路由的子接口

2在SW1增加vlan1000 并配置一个acc口给vlan1000 该acc口与路由做acc连接 给vlan接口1000配置IP地址为172.16.0.2
在SW1增加静态路由 0.0.0.0 0.0.0.0 172.16.0.1
路由下联口配置IP 172.16.0.1/24 并添加回指路由 192.168.101.0 255.255.255.0 172.16.0.2和192.168.201.0 255.255.255.0 172.16.0.2

方法1为单臂路由
方法2为三层
恋上雨季 2019-07-11
  • 打赏
  • 举报
回复
看路由器配置,路由下口应该是acac
天煞的二货 2019-07-11
  • 打赏
  • 举报
回复
路由器配置发上来看下
yyyayo 2019-07-11
  • 打赏
  • 举报
回复
然后这是路由器Router0的 R0#sh run Building configuration... Current configuration : 717 bytes ! version 15.1 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname R0 ! ip cef no ipv6 cef ! license udi pid CISCO2911/K9 sn FTX1524ERZU- ! spanning-tree mode pvst ! interface GigabitEthernet0/0 ip address 200.200.1.1 255.255.255.0 duplex auto speed auto ! interface GigabitEthernet0/1 ip address 192.168.101.253 255.255.255.0 duplex auto speed auto ! interface GigabitEthernet0/2 no ip address duplex auto speed auto shutdown ! interface Vlan1 no ip address shutdown ! ip classless ! ip flow-export version 9 ! ! line con 0 ! line aux 0 ! line vty 0 4 login ! ! ! end
yyyayo 2019-07-11
  • 打赏
  • 举报
回复
本人超级小白,先把路由器和交换机的配置发上来给大家看看 下面是交换机Switch1的 SW1#sh run Building configuration... Current configuration : 1612 bytes ! version 12.2(37)SE1 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname SW1 ! ip routing ! ! spanning-tree mode pvst ! ! interface FastEthernet0/1 switchport access vlan 101 ! interface FastEthernet0/2 switchport access vlan 201 ! interface FastEthernet0/3 switchport access vlan 101 ! interface FastEthernet0/4 ! interface FastEthernet0/5 ! interface FastEthernet0/6 ! interface FastEthernet0/7 ! interface FastEthernet0/8 ! interface FastEthernet0/9 ! interface FastEthernet0/10 ! interface FastEthernet0/11 ! interface FastEthernet0/12 ! interface FastEthernet0/13 ! interface FastEthernet0/14 ! interface FastEthernet0/15 ! interface FastEthernet0/16 ! interface FastEthernet0/17 ! interface FastEthernet0/18 ! interface FastEthernet0/19 ! interface FastEthernet0/20 ! interface FastEthernet0/21 ! interface FastEthernet0/22 ! interface FastEthernet0/23 ! interface FastEthernet0/24 switchport trunk encapsulation dot1q switchport mode trunk ! interface GigabitEthernet0/1 switchport access vlan 101 ! interface GigabitEthernet0/2 ! interface Vlan1 no ip address shutdown ! interface Vlan101 mac-address 0005.5e45.9201 ip address 192.168.101.1 255.255.255.0 ! interface Vlan201 mac-address 0005.5e45.9202 ip address 192.168.201.2 255.255.255.0 ! router ospf 1 log-adjacency-changes network 192.168.101.0 0.0.0.255 area 0 network 192.168.201.0 0.0.0.255 area 0 ! ip classless ! ip flow-export version 9 ! ! line con 0 ! line aux 0 ! line vty 0 4 login ! end
qq_44818282 2019-07-09
  • 打赏
  • 举报
回复
你给路由器配置子接口了?
F&G 2019-07-08
  • 打赏
  • 举报
回复
路由器不接收带帧的tag或者做单臂路由子接口封装vlan。d
F&G 2019-07-08
  • 打赏
  • 举报
回复
连路由器的口改为access口
Iforgetmyid 2019-07-07
  • 打赏
  • 举报
回复
路由设置禁ping没有?
weixin_44732232 2019-07-06
  • 打赏
  • 举报
回复
连路由的那个接口改为trunk

3,835

社区成员

发帖
与我相关
我的任务
社区描述
硬件使用 交换及路由技术相关问题讨论专区
社区管理员
  • 交换及路由技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧