设为首页收藏本站language→→ 语言切换

鸿鹄论坛

 找回密码
 论坛注册

QQ登录

先注册再绑定QQ

查看: 876|回复: 2
收起左侧

[原创] PC如何能PING通R1、R2以及与R2下的PC通信

[复制链接]
发表于 2018-9-21 14:15:46 | 显示全部楼层 |阅读模式
10鸿鹄币

拓扑

拓扑




拓扑如图  可能会看不清楚,附件内有实验

目前情况,跟由与路由之间不通

R1与R2 下的PC 不能与路由通信

路由下的PC也不能互相通信

PC可 PING通三层交换机   三层交换机可PING通路由内网地址与外网地址

目的:
使两台路由之间能互相通信,R1下的PC能与R2下的PC通信

部份配置应该是错的,大神指导,感谢!!

配置如下:
R1
R1#show run
Building configuration...

Current configuration : 991 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R1
!
!
!
enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
enable password cisco
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2911/K9 sn FTX15242C70
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0
ip address 10.2.1.1 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/1
ip address 192.168.0.1 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 route 192.168.10.0 255.255.255.0 10.1.1.1
ip route 192.168.20.0 255.255.255.0 10.1.1.1
ip route 0.0.0.0 0.0.0.0 192.168.1.1
ip route 0.0.0.0 0.0.0.0 192.168.2.1
ip route 192.168.1.0 255.255.255.0 10.1.1.1
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end

---------------------------------------------------------------------------------------------------------------------------
R2
R2#show run
Building configuration...

Current configuration : 779 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R2
!
!
!
enable password cisco
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2911/K9 sn FTX1524YITZ
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0
ip address 10.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/1
ip address 192.168.10.254 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 route 192.168.0.0 255.255.255.0 10.2.1.1
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end

------------------------------------------------------------------------------------------------
SW1
SW1#show run
Building configuration...

Current configuration : 1701 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW1
!
!
!
enable password cisco
!
!
!
ip dhcp pool vlan10
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 202.106.0.20
ip dhcp pool vlan20
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
dns-server 202.106.0.20
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/1
!
interface FastEthernet0/2
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/3
switchport access vlan 20
switchport mode access
!
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
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
ip address 192.168.0.2 255.255.255.0
!
interface Vlan10
mac-address 0030.f2ea.4001
ip address 192.168.1.1 255.255.255.0
!
interface Vlan20
mac-address 0030.f2ea.4002
ip address 192.168.2.1 255.255.255.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.0.1
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
password cisco
login
!
!
!
end
------------------------------------------------------------------------------

SW2
sw2#show run
Building configuration...

Current configuration : 1705 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname sw2
!
!
!
!
!
ip dhcp pool vlan10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server 202.106.0.20
ip dhcp pool vlan20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
dns-server 202.106.0.20
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/1
!
interface FastEthernet0/2
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/3
switchport access vlan 20
switchport mode access
!
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
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
ip address 192.168.0.1 255.255.255.0
!
interface Vlan10
mac-address 0001.43c3.2b01
ip address 192.168.10.1 255.255.255.0
!
interface Vlan20
mac-address 0001.43c3.2b02
ip address 192.168.20.1 255.255.255.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.10.254
ip route 0.0.0.0 0.0.0.0 10.1.1.1
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!

end

两路由通信.pkt

146.31 KB, 下载次数: 0, 下载积分: 鸿鹄币 -1 个

PKT实验

发表于 2018-9-21 15:00:01 | 显示全部楼层
三层交换机没开VLAN间路由。
左边路由器和右边路由器背后的网络都有192.168.1.0/24网段,这样的编址你让路由器遇到去这个网段的数据包,到底往哪走。
还有你每个设备都写默认路由,你真的知道数据包会按你的想法去走吗?
遇到网不通,就多用用ping、traceroute去看看数据包的走向。
在路由器上show ip route去看看路由表,到底需要打通的网段有没有加到路由表,如果加入了,下一跳都是指到哪里。
沙发 2018-9-21 15:00:01 回复 收起回复
回复

使用道具 举报

发表于 2020-7-23 22:08:32 | 显示全部楼层
感谢楼主分享
板凳 2020-7-23 22:08:32 回复 收起回复
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2024-4-29 00:39 , Processed in 0.065033 second(s), 9 queries , Redis On.  

  Powered by Discuz!

  © 2001-2024 HH010.COM

快速回复 返回顶部 返回列表