A-A+
华为交换机vlan间路由器子接口的配置和方法
按照下图来组网,采用比较流行的华为交换机和路由器来架设一个VLAN,通过子接口来进行连接。下面是拓扑图和配置命令行:
路由器的配置:
- interface Ethernet0/0/0
- undo shutdown
- #
- interface Ethernet0/0/0.1
- vlan-type dot1q 2
- ip address 192.168.2.1 255.255.255.0
- #
- interface Ethernet0/0/0.2
- vlan-type dot1q 3
- ip address 192.168.3.1 255.255.255.0
交换机的配置:
- vlan batch 2 to 3
- interface Ethernet0/0/1
- port link-type access
- port default vlan 2
- #
- interface Ethernet0/0/2
- port link-type access
- port default vlan 3
- interface GigabitEthernet0/0/1
- port link-type trunk
- port trunk allow-pass vlan 2 to 4094