利用单个三层交换机实现不同vlan和不同网段之间互通(华为和cisco)
时间: 2023-12-14 12:05:37 浏览: 199
在华为和Cisco的交换机中,实现不同VLAN和不同网段之间的互通需要进行如下配置:
华为交换机:
1. 配置VLAN
```
vlan batch 10 20 30
interface vlanif 10
ip address 192.168.10.1 24
interface vlanif 20
ip address 192.168.20.1 24
interface vlanif 30
ip address 192.168.30.1 24
```
2. 配置端口
将需要加入VLAN的端口加入对应的VLAN中,同时配置端口地址和端口所属的VLAN。
```
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
```
3. 配置交换机端口
将交换机端口连接到路由器的端口上,并进行如下配置:
```
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30
```
Cisco交换机:
1. 配置VLAN
```
vlan 10
name VLAN10
interface vlan 10
ip address 192.168.10.1 255.255.255.0
vlan 20
name VLAN20
interface vlan 20
ip address 192.168.20.1 255.255.255.0
vlan 30
name VLAN30
interface vlan 30
ip address 192.168.30.1 255.255.255.0
```
2. 配置端口
将需要加入VLAN的端口加入对应的VLAN中,同时配置端口地址和端口所属的VLAN。
```
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
interface FastEthernet0/2
switchport access vlan 20
switchport mode access
interface FastEthernet0/3
switchport access vlan 30
switchport mode access
```
3. 配置交换机端口
将交换机端口连接到路由器的端口上,并进行如下配置:
```
interface GigabitEthernet0/1
switchport mode trunk
switchport trunk allowed vlan 10,20,30
```
阅读全文