- 一、单臂路由的概述
- 二、单臂路由的原理
- 三、配置命令
- 四、单臂路由配置实例
- 下半部分
- 上半部分
单臂路由(router-on-a-stick)是指在路由器的一个接口上通过配置子接口(或"逻辑接口",并不存在真正物理接口)的方式,实现原来相互隔离的不同VLAN(虚拟局域网)之间的互联互通。
链路类型:
- 交换机连接主机的端口为access链路
- 交换机连接路由器的端口为Trunk链路
子接口:
- 路由器的物理接口可以被划分为多个逻辑接口
- 每个子接口对应一个vlan网段的网关
路由器重新封装MAC地址,转换VLAN标识
[R1] interface g0/0/0.10 [Huawei -GigabitEthernet0/0/0. 10]dot1q termination vid 10 [Huawei-Gigabi tEthernet0/0/0.10]ip add 192.168.10.1 24 [Huawei-Gigabi tEthernet0/0/0.10]arp broadcast enable ###开启向下arp广播请求功能 [R1 ]int g0/0/0 [Huawei-GigabitEthernet0/0/0]un sh[R1]dis ip interface brief四、单臂路由配置实例
可以 *** 作分为两个部分:上半部分和下半部分
下半部分SW1
sys ##进入系统视图 Enter system view, return user view with Ctrl+Z. [Huawei]sys SW1 ##重命名 [SW1] [SW1]un in en ##关闭提醒 Info: Information center is disabled. [SW1]vlan batch 10 20 30 40 50 ##批量创建 Info: This operation may take a few seconds. Please wait for a moment...done. [SW1]int e0/0/1 ##进入e0/0/1端口 [SW1-Ethernet0/0/1]port link-type access ##进入access接口 [SW1-Ethernet0/0/1]port default vlan 10 ##默认为vlan2 [SW1-Ethernet0/0/1]un sh Info: Interface Ethernet0/0/1 is not shutdown. [SW1-Ethernet0/0/1]q [SW1]int e0/0/2 [SW1-Ethernet0/0/2]p l a [SW1-Ethernet0/0/2]p d v 20 [SW1-Ethernet0/0/2]q [SW1]int e0/0/3 [SW1-Ethernet0/0/3]p l a [SW1-Ethernet0/0/3]p d v 30 [SW1-Ethernet0/0/3]q [SW1]int e0/0/4 [SW1-Ethernet0/0/4]p l t [SW1-Ethernet0/0/4]p t a v a [SW1-Ethernet0/0/4]q [SW1]int e0/0/5 [SW1-Ethernet0/0/5]p l t [SW1-Ethernet0/0/5]p t a v a [SW1-Ethernet0/0/5]dis vlan
SW2
sys Enter system view, return user view with Ctrl+Z. [Huawei]sys SW2 [SW2] [SW2]un in en Info: Information center is disabled. [SW2]vlan batch 40 50 Info: This operation may take a few seconds. Please wait for a moment...done. [SW2]int e0/0/1 [SW2-Ethernet0/0/1]p l a [SW2-Ethernet0/0/1]p d v 40 [SW2-Ethernet0/0/1]q [SW2]int e0/0/2 [SW2-Ethernet0/0/2]p l a [SW2-Ethernet0/0/2]p d v 50 [SW2-Ethernet0/0/2]q [SW2]int e0/0/3 [SW2-Ethernet0/0/3]p l t [SW2-Ethernet0/0/3]p t a v a
R1
上半部分sys Enter system view, return user view with Ctrl+Z. [Huawei]sys R2 [R2]un in en Info: Information center is disabled. [R2]vlan batch 10 20 30 40 50 ### 单臂路由 [R2]int g0/0/0.10 ##进入子接口视图 [R2]dot1q termination vid 10 ##配置标签封装结构 [R2]ip add 192.168.1.1 24 ##网关 [R2]arp broadcast enable ##开启向下ARP广播请求功能 [R2]int g0/0/0.20 [R2]dot1q t v 20 [R2]ip add 192.168.2.1 24 [R2]a b e [R2]int g0/0/0.30 [R2]d t v 30 [R2]ip add 192.168.3.1 24 [R2]a b e [R2]int g0/0/0.40 [R2]d t v 40 [R2]ip add 192.168.4.1 24 [R2]a b e [R2]int g0/0/0.50 [R2]dot1q termination vid 50 [R2]ip add 192.168.5.1 24 [R2]a b e [R2]q R2]int g0/0/1 [R2]ip add 10.0.0.1 24 [R2]ip route-static 192.168.6.0 24 10.0.0.2
R2
sys Enter system view, return user view with Ctrl+Z. [Huawei]sys R2 [R2]un in en Info: Information center is disabled. [R2]int g0/0/0 [R2-GigabitEthernet0/0/0]ip add 10.0.0.2 24 [R2-GigabitEthernet0/0/0]q [R2]int g0/0/1 [R2-GigabitEthernet0/0/1]ip add 192.168.6.1 24 [R2-GigabitEthernet0/0/1]ip route-static 192.168.2.0 24 10.0.0.1 ##静态路由
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)