Cisco单臂路由
:IT学习乐园
:Builder
:20241121
:1K+

--------------------------------------------------

实验拓朴如下所示:

Router1 F0/0 <----> Switch1 F0/0 
Router2 F0/0 <----> Switch1 F0/2 
Router3 F0/0 <----> Switch1 F0/3

Router2模拟PC1

Router3模拟PC2

---------------------------------------------------

Router配置如下:


R1#show run
Building configuration...

Current configuration : 969 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$n0zm$PN/BmCcv3eDTHZh7SKlIa0
enable password 7 070C285F4D06
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
!
!
ip cef    
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!

!
!
!
!         
interface FastEthernet0/0
 no ip address

 duplex auto
 speed auto
!
interface FastEthernet0/0.1
 encapsulation dot1Q 10
 ip address 192.168.10.1 255.255.255.0

 no snmp trap link-status
!
interface FastEthernet0/0.2
 encapsulation dot1Q 20
 ip address 192.168.20.1 255.255.255.0

 no snmp trap link-status
!
ip http server
no ip http secure-server
!
!
!
!
!
!         
control-plane
!
!
!
!
!
!
!
!
!
banner motd ^C Welcome to connect to Router1 ^C
!
line con 0
 exec-timeout 0 0
 password 7 13061E010803
 logging synchronous
 login
line aux 0
line vty 0 4
 exec-timeout 0 0
 password 7 121A0C041104
 login
!         
!
end

R1# 

 

Switch1配置如下:


SW1(config-if)#
SW1(config-if)#do show run
Building configuration...

Current configuration : 1332 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname SW1
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$jDEt$urSKepgFFOhpJUr2zCBI./
enable password 7 094F471A1A0A
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
no ip routing
!
!         
no ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!

!
!
!         
!
interface FastEthernet0/0
 switchport mode trunk

!
interface FastEthernet0/1
!
interface FastEthernet0/2
 switchport access vlan 10

!
interface FastEthernet0/3
 switchport access vlan 20

!
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 Vlan1
 no ip address
 no ip route-cache
!
interface Vlan10
 no ip address
!
interface Vlan20
 no ip address
!         
ip http server
no ip http secure-server
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
banner motd ^C Welcome to connect to Switch1 ^C
!
line con 0
 exec-timeout 0 0
 password 7 121A0C041104
 logging synchronous
 login
line aux 0
line vty 0 4
 exec-timeout 0 0
 password 7 094F471A1A0A
 login
!
!
end

SW1(config-if)#

 

PC1配置如下:


PC1#
PC1#show run
Building configuration...

Current configuration : 820 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname PC1
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$G4ki$Zr6auP951YVR9ePzZbm3J1
enable password 7 104D000A0618
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
no ip routing
!
!         
no ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!

!
!
!         
!
interface FastEthernet0/0
 ip address 192.168.10.2 255.255.255.0

 no ip route-cache
 duplex auto
 speed auto
!
ip default-gateway 192.168.10.1
ip http server
no ip http secure-server
!
!
!
!
!
!
control-plane
!
!
!
!
!
!         
!
!
!
banner motd ^C Welcome to connect to PC1 ^C
!
line con 0
 exec-timeout 0 0
 password 7 030752180500
 logging synchronous
 login
line aux 0
line vty 0 4
 exec-timeout 0 0
 password 7 030752180500
 login
!
!
end

PC1#

 

PC2配置如下:


PC2#
PC2#
PC2#show run
Building configuration...

Current configuration : 820 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname PC2
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$L6FH$aajyxeQtve35b3GbYxa9//
enable password 7 1511021F0725
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
no ip routing
!
!         
no ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!

!
!
!         
!
interface FastEthernet0/0
 ip address 192.168.20.2 255.255.255.0

 no ip route-cache
 duplex auto
 speed auto
!
ip default-gateway 192.168.20.1
ip http server
no ip http secure-server
!
!
!
!
!
!
control-plane
!
!
!
!
!
!         
!
!
!
banner motd ^C Welcome to connect to PC2 ^C
!
line con 0
 exec-timeout 0 0
 password 7 030752180500
 logging synchronous
 login
line aux 0
line vty 0 4
 exec-timeout 0 0
 password 7 094F471A1A0A
 login
!
!
end

PC2#

 

--------------------------------------------------------------

在PC1和PC2上进行验证:

PC1# ping 192.168.20.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/25/76 ms
PC1# ping 192.168.20.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/36/52 ms
PC1#

PC2# ping 192.168.10.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/32/72 ms
PC2# ping 192.168.10.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/36/60 ms
PC2#

---------------------------------------------

注意事项。

Router1 F0/0接口需用no shutdown开启,用encapsulation xxx封格式数据包。

PC1及PC2在全局模式下用PCX(Config)# ip default-gateway xxx.xxx.xxx.xxx配置默认网关。





阿里ECS新春特惠
阿里ECS新春特惠

2022年2月20日期前,您点击链接,并完成实名认证,即...

立刻前往...
阿里新人特惠专享
阿里新人特惠专享

新用户首购1元起,精选云服务器ECS 1核2G n4 9...

立刻前往...
阿里对象存储OSS
阿里对象存储OSS

个人新用户免费试用3个月;企业新用户免费试用3个月!...

立刻前往...
企业上云钜惠
企业上云钜惠

多款刚需产品,满足企业通用场景需求,云服务器2.5折起...

立刻前往...