单臂路由

单臂路由配置流程:

1、交换机端口的类型配置及vlan绑定配置

  interface Ethernet0/0/2(接入pc4的交换机上的接口)

  port link-type access

  port default vlan 10

  interface Ethernet0/0/3(接入pc5的交换机上的接口)

  port link-type access

  port default vlan 20

  interface Ethernet0/0/1(接入路由器的交换机上的接口)

  port link-type trunk

  port trunk allow-pass vlan 10 20

2、路由器

  a、创建逻辑子接口,并配置对应的IP地址:

  interface g0/0/0.1

  ip address 192.168.10.254 255.255.255.0(或24)

  b、把逻辑子接口和对应的vlan绑定:

  interface g0/0/0.1

  dot1q termination vid 10

(注:使用dot1q termination vid命令配置子接口对一层tag报文的终结功能。即配置该命令后,路由器子接口在接收带有vlan tag的报文时,将剥掉tag进行三层转发,在发送报文时,会将与该子接口对应的vlan的vlan tag添加到报文中。)

  c、允许逻辑子接口接受和处理来自交换机的数据:

  interface g0/0/0.1

  arp broadcast enable

(注:使用arp broadcast enable命令开启子接口的arp广播功能。如果不配置该命令,将会导致子接口无法主动发送arp广播报文,以及向外转发IP报文。)

  d、逻辑子接口g0/0/0.2和g0/0/0.1一样的配置

注意:pc机要配置网关,为对应的路由器逻辑子接口,不然会不可达

单臂路由拓扑:

交换机配置:

路由配置:

ping测试:

原文地址:https://www.cnblogs.com/liang-chen/p/11494921.html