02-單臂路由實驗
阿新 • • 發佈:2018-11-11
單臂路由實驗
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通