ensp不同vlan互通
时间: 2023-11-29 17:45:53 浏览: 132
为了实现不同VLAN之间的通信,需要使用路由器或三层交换机。如果使用二层交换机,可以通过VLAN间路由(即SVI)实现不同VLAN之间的通信。下面是实现不同VLAN之间通信的步骤:
1. 配置VLAN 100 和 VLAN 200
```
<Huawei> system-view
[Huawei] vlan 100
[Huawei-vlan100] quit
[Huawei] vlan 200
[Huawei-vlan200] quit
```
2. 配置接口所属的VLAN
```
<Huawei> system-view
[Huawei] interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1] port link-type access
[Huawei-GigabitEthernet0/0/1] port default vlan 100
[Huawei-GigabitEthernet0/0/1] quit
[Huawei] interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/2] port link-type access
[Huawei-GigabitEthernet0/0/2] port default vlan 200
[Huawei-GigabitEthernet0/0/2] quit
```
3. 配置VLAN间路由
```
<Huawei> system-view
[Huawei] interface Vlanif 100
[Huawei-Vlanif100] ip address 100.100.100.1 24
[Huawei-Vlanif100] quit
[Huawei] interface Vlanif 200
[Huawei-Vlanif200] ip address 200.200.200.1 24
[Huawei-Vlanif200] quit
[Huawei] ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
```
4. 配置PC的IP地址
```
PC1: 100.100.100.2
PC2: 100.100.100.3
PC3: 200.200.200.2
PC4: 200.200.200.3
```
5. 验证PC之间的互通性
```
PC1 ping PC2
PC3 ping PC4
PC1 ping PC3
PC2 ping PC4
```
阅读全文