一、單臂路由
1.1概念
單臂路由實作不同vlan之間通信
1.2鏈路型別
access鏈路:交換機連接主機的埠
trunk鏈路:交換機連接路由器的埠
hybrid鏈路:華為
1.3子介面
路由的物理介面可以被劃分為多個邏輯介面
每個子介面對應一個vlan網段的網關
1.4單臂路由的配置
(1)配置鏈路型別
(2)配置vlan標簽的封裝結構
(3)配置子介面地址
1.5例題
例題1:
實驗結果:
代碼:
例題2:
實驗結果:
實驗代碼:
SW1:
vlan batch 10 20
port-group 1
group-member g0/0/1 to g0/0/2
port link-type access
port default vlan 10
q
port-group 2
group-member g0/0/3 to g0/0/4
port link-type access
port default vlan 20
q
port-group 3
group-member g0/0/5 to g0/0/6
port link-type trunk
port trunk allow-pass vlan all
SW2:
vlan batch 10 20
int g0/0/1
port link-type trunk
port trunk allow-pass vlan all
int g0/0/2
port link-type access
port default vlan 10
int g0/0/3
port link-type access
port default vlan 20
AR1:
int g0/0/0.10
dotlq termination vid 10
ip add 192.168.10.1 24
arp broadcast enable
int g0/0/0.20
dotlq termination vid 120
ip add 192.168.20.1 24
arp broadcast enable
二、三層交換(選型失敗使用)
2.1三層交換技術
使用三層交換技術實作vlan間通訊
三層交換=二層交換+三層轉發
2.2三層交換機實作vlan間通信
2.3例子
實驗結果:
實驗代碼:
SW1:
vlan batch 10 20 30
int e0/0/1
port link-type access
port default vlan 10
int e0/0/2
port link-type access
port default vlan 20
int e0/0/3
port link-type access
port default vlan 30
int e0/0/4
port link-type trunk
port trunk allow-pass vlan all
SW2:
vlan batch 10 20 30
int Vlanif 10
ip add 192.168.1.254 24
int Vlanif 20
ip add 192.168.2.254 24
int Vlanif 30
ip add 192.168.3.254 24
int Vlanif 100
ip add 192.168.4.1 24
int g0/0/1
port link-type trunk
port trunk allow-pass vlan all
int g0/0/2
port link-type access
port default vlan 100
q
ip route-static 192.168.5.0 24 192.168.4.2
AR1:
int g0/0/0
ip add 192.168.4.2 24
int g0/0/1
ip add 192.168.5.254
q
ip route-static 192.168.1.0 24 192.168.4.1
ip route-static 192.168.2.0 24 192.168.4.1
ip route-static 192.168.3.0 24 192.168.4.1
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/506558.html
標籤:其他