思科模拟器——单臂路由

网上看到一个拓扑图,之前的博主留了一手,给的命令不可以将PC机ping通。

我加了命令,将其ping通,也算是原创吧!

配置交换机SWA

Switch #configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#no logging console

Switch(config)#hostname SWA

SWA(config)#vlan 10

SWA(config-vlan)#vlan 20

SWA(config-vlan)#vlan 30

SWA(config-vlan)#exit

SWA(config)#interface fa0/1

SWA(config-if)#switchport mode trunk

SWA(config-if)#switchport trunk allowed vlan all

SWA(config-if)#interface fa0/2

SWA(config-if)#switchport mode trunk

SWA(config-if)#switchport trunk allowed vlan all

SWA(config-if)#exit

SWA(config)#interface fa0/3

SWA(config-if)#switchport mode access

SWA(config-if)#switchport access vlan 10

SWA(config-if)#

交换机SWB的配置

Switch>enable

Switch #configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#no logging console

Switch(config)#hostname SWB

SWB(config)#vlan 20

SWB(config-vlan)#vlan 30

SWB(config-vlan)#exit

SWB(config)#interface fa0/1

SWB(config-if)#switchport mode trunk

SWB(config-if)#switchport trunk allowed vlan all

SWB(config-if)#interface fa0/2

SWB(config-if)#switchport mode access

SWB(config-if)#switchport access vlan 20

SWB(config-if)#interface fa0/3

SWB(config-if)#switchport mode access

SWB(config-if)#switchport access vlan 30

SWB(config-if)#

交换机SWC的配置

Switch>enable

Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#interface fa0/1

Switch(config-if)#switchport mode trunk

Switch(config-if)#switchport trunk allowed vlan all

Switch(config-if)#exit

Switch(config)#interface range fa0/2-3

Switch(config-if-range)#switchport mode access

Switch(config-if-range)#switchport access vlan 40

% Access VLAN does not exist. Creating vlan 40

Switch(config-if-range)#

路由器A的配置

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#no logging console

Router(config)#hostname RA

RA(config)#interface fa0/0

RA(config-if)#no shutdown

RA(config-if)#interface f0/0.1

RA(config-subif)#encapsulation dot1q 10

RA(config-subif)#ip address 192.168.10.254 255.255.255.0

RA(config-subif)#exit

RA(config)#interface f0/0.2

RA(config-subif)#encapsulation dot1q 20

RA(config-subif)#ip address 192.168.20.254 255.255.255.0

RA(config-subif)#exit

RA(config)#interface f0/0.3

RA(config-subif)#encapsulation dot1q 30

RA(config-subif)#ip address 192.168.30.254 255.255.255.0

RA(config-subif)#exit

RA(config)#interface fa0/1

RA(config-if)#ip address 1.1.1.1 255.255.255.252

RA(config-if)#no shutdown

RA(config-if)#exit

RA(config)#ip route 192.168.40.0 255.255.255.0 1.1.1.2

RA(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2

RA(config)#

路由器RB的配置

Router>enable

Router #configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#no logging console

Router(config)#hostname RB

RB(config)#interface fa0/0

RB(config-if)#no shutdown

RB(config-if)#interface f0/0.4

RB(config-subif)#encapsulation dot1q 40

RB(config-subif)#ip address 192.168.40.254 255.255.255.0

RB(config-subif)#exit

RB(config)#interface fa0/1

RB(config-if)#ip address 1.1.1.2 255.255.255.252

RB(config-if)#no shutdown

RB(config-if)#exit

RB(config)#ip route 192.168.0.0 255.255.255.0 1.1.1.1

RB(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.1

RB(config)#

结论:配置完成之后,处于不同vlan的所有PC机以及服务器可以相互ping通

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值