02-单臂路由实验

单臂路由实验

1.单臂路由介绍

单臂路由(router-on-a-stick)是指在路由器的一个接口上通过配置子接口或“逻辑接口”,并不存在真正物理接口)的方式,实现原来相互隔离的不同VLAN(虚拟局域网)之间的互联互通。

2.单臂路由模拟实验

2.1实验拓扑

2.2实验要求

设备 接口 IP Netmask Gateway Vlan
R1 GE0/0/1.1 192.168.1.254 255.255.255.0 None  
GE0/0/1.2 192.168.2.254 255.255.255.0 None  
GE0/0/1.3 192.168.3.254 255.255.255.0 None  
PC1 Ethernet0/0/1 192.168.1.1 255.255.255.0 192.168.1.254 10
PC2 Ethernet0/0/1 192.168.2.1 255.255.255.0 192.168.2.254 20
PC3 Ethernet0/0/1 192.168.3.1 255.255.255.0 192.168.3.254 30

 

2.3交换机配置

SW1

sysname SW1
#
vlan batch 10 20 30
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20 30
#

SW2

sysname SW2
#
vlan batch 10 20
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 20
#

SW3

sysname SW3
#
vlan batch 30
#
interface Ethernet0/0/1
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30
#

2.4路由器配置

 sysname R1
#
interface GigabitEthernet0/0/1.1
# 配置子接口对一层tag报文的终结功能 dot1q termination vid 10 ip address 192.168.1.254 255.255.255.0
# 开启子接口的ARP广播功能 arp broadcast enable # interface GigabitEthernet0/0/1.2
# 配置子接口对一层tag报文的终结功能 dot1q termination vid 20 ip address 192.168.2.254 255.255.255.0
# 开启子接口的ARP广播功能 arp broadcast enable # interface GigabitEthernet0/0/1.3
# 配置子接口对一层tag报文的终结功能 dot1q termination vid 30 ip address 192.168.3.254 255.255.255.0
# 开启子接口的ARP广播功能 arp broadcast enable #

2.5实验结果

三台PC可以相互ping通

原文地址:https://www.cnblogs.com/gongniue/p/9941226.html