单臂路由

一、单臂路由的配置
、配置环境
实验软件:EVE-NG
思科ios版本:
R1路由器:version 15.7
S1交换机:version 15.2
拓扑图(有点简陋):

1、在路由器上配置单臂路由

  1. 首先在S1交换机上创建vlan10(192.168.1.0/24)、vlan20(192.168.2.0/24)并将接口与vlan绑定
  2. 在路由器上进行配置
    配置步骤为:
    开启e0/0接口
    进入子接口
    以太网帧封装为dot1q
    配置子接口ip
    配置命令为:
R1(config)#interface ethernet 0/0
R1(config-if)#no shutdown
R1(config-if)#interface ethernet 0/0.1
R1(config-subif)#encapsulation dot1q 10
R1(config-subif)#ip address 192.168.1.254 255.255.255.0
R1(config-subif)#interface ethernet 0/0.2
R1(config-subif)#encapsulation dot1q 20
R1(config-subif)#ip address 192.168.2.254 255.255.255.0

在路由器上检验一下是否有路由表

R1#show ip route 
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Ethernet0/0.1
L        192.168.1.254/32 is directly connected, Ethernet0/0.1
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, Ethernet0/0.2
L        192.168.2.254/32 is directly connected, Ethernet0/0.2
R1#

路由表存在,接下来尝试用pc机进行ping测试
在这里插入图片描述
可以ping通。

2、在三层交换机上配置单臂路由

  1. 首先在S2交换机上创建vlan10(192.168.3.0/24)、vlan20(192.168.4.0/24)并将接口与vlan绑定
  2. 在三层交换机上进行配置
    配置步骤为:
    启用路由功能
    创建vlan10、vlan20
    配置ip地址
    配置命令为
Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
Switch(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
Switch(vlan)#exi
APPLY completed.
Exiting....
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
S3(config)#interface vlan 10
S3(config-if)#ip add 192.168.4.254 255.255.255.0
S3(config-if)#no shut
S3(config-if)#interface vlan 20
S3(config-if)#ip add 192.168.5.254 255.255.255.0
S3(config-if)#no shut
S3(config-if)#interface ethernet 0/1
S3(config-if)#switch mode trunk
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值