跨网段跨vlan访问管理vlan
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了跨网段跨vlan访问管理vlan相关的知识,希望对你有一定的参考价值。
管理vlan和办公vlan不是同一个,甚至是跨交换机。
实验名称 | 跨网段,跨vlan访问管理vlan |
实验拓扑 | |
思路: Trunk/默认路由(等于思科默认网关) 说明: 管理vlan 1,要求从PC能访问任意vlan 1.
//配置SW1 <H3C>system-view [H3C]sysname SW1 [SW1]int vlan1 [SW1-Vlan-interface1]ip add 192.168.1.1 29 [SW1-Vlan-interface1]vlan 10 [SW1-vlan10]int vlan10 [SW1-Vlan-interface10]ip add 192.168.10.1 24 [SW1-Vlan-interface10]vlan 20 [SW1-vlan20]int vlan20 [SW1-Vlan-interface20]ip add 192.168.20.1 24 [SW1-Vlan-interface20]quit
//配置接口为trunk [SW1]int g1/0/1 [SW1-GigabitEthernet1/0/1]port link-type trunk [SW1-GigabitEthernet1/0/1]port trunk permit vlan 10 //不写all,避免垃圾流量。 [SW1-GigabitEthernet1/0/1]int g1/0/2 [SW1-GigabitEthernet1/0/2]port link-type trunk [SW1-GigabitEthernet1/0/2]port trunk permit vlan 20 //SW1配置完毕
//配置SW2 <H3C>syst [H3C]sysn SW2 [SW2]int g1/0/1 [SW2-GigabitEthernet1/0/1]port link-type trunk [SW2-GigabitEthernet1/0/1]port trunk permit vlan 10 [SW2-GigabitEthernet1/0/1]int g1/0/2 [SW2-GigabitEthernet1/0/2]port link-type access [SW2-GigabitEthernet1/0/2]vlan 10 [SW2-vlan10]port g1/0/2 [SW2-vlan10]int vlan1 [SW2-Vlan-interface1]ip add 192.168.1.2 29
//vlan 1 IP已配完,但10网段的访问不到,还需要添加默认路由 [SW2]ip route-static 0.0.0.0 0 192.168.1.1
//配置SW3,和SW2一样 <H3C>syst [H3C]sysn SW3 [SW3]int g1/0/1 [SW3-GigabitEthernet1/0/1]port link-type trunk [SW3-GigabitEthernet1/0/1]port trunk permit vlan 20 [SW3-GigabitEthernet1/0/1]int g1/0/2 [SW3-GigabitEthernet1/0/2]port link-type access [SW3-GigabitEthernet1/0/2]vlan 20 [SW3-vlan20]port g1/0/2 [SW3-vlan20]int vlan1 [SW3-Vlan-interface1]ip add 192.168.1.3 29 [SW3]ip route-static 0.0.0.0 0 192.168.1.1
| |
实验验证:全网互通 | |
以上是关于跨网段跨vlan访问管理vlan的主要内容,如果未能解决你的问题,请参考以下文章