NETCORE磊科三层交换机多网段配置举例

华为三层交换机请参阅:
华为交换机CLI方式配置跨网段访问

一. 组网说明
在交换机上启用 DHCP 服务器,为网络中的 PC 分配动态 IP 地址。
VLAN 10 使用 10.1.1.1/24网段的地址,网关 10.1.1.1.。
VLAN 20 使用 192.168.20.1/24 网段的地址,网关 192.168.20.1
二. 组网图

注:交换机默认就开启了接口路由,那么当两台 PC 分别从 DHCP Server 交换机上获取了 IP地址,直接两台 PC 就可以正常通信了。
三. CLI 配置步骤
1、创建 VLAN 10
switch(config)#vlan 10
switch(config-vlan10)#exit

2、将端口 ETH 1/0/1 加入 VLAN 10
switch(config)#interface ethernet 1/0/1
switch(config-if-ethernet1/0/1)#switchport access vlan 10
switch(config-if-ethernet1/0/1)#exit

3 、为 VLAN 10 分配接口 IP
switch(config)#interface vlan 10
switch(config-if-vlan10)#ip address 10.1.1.1 255.255.255.0
switch(config-if-vlan10)#exit

4、创建 VLAN20
switch(config)#vlan 20
switch(config-vlan20)#exit

5 、将端口 ETH 1/0/2 加入 VLAN 20
switch(config)#interface ethernet 1/0/2
switch(config-if-ethernet1/0/2)#switchport access vlan 20
switch(config-if-ethernet1/0/2)#exit

6 、为 VLAN20 分配接口 IP
switch(config)#interface vlan 20
switch(config-if-vlan20)#ipaddress 192.168.20.1 255.255.255.0
switch(config-if-vlan20)#exit

7 、启用 DHCP SERVER 功能
switch(config)#service dhcp

8 、创建 VLAN 10 地址池
switch(config)#ip dhcp pool vlan10
switch(dhcp-vlan10-config)#network-address 10.1.1.1 24
switch(dhcp-vlan10-config)#default-router 10.1.1.1
switch(dhcp-vlan10-config)#exit

9 、创建 VLAN20 地址池
switch(config)#ip dhcp pool vlan20
switch(dhcp-vlan20-config)#network-address 192.168.20.1 24
switch(dhcp-vlan20-config)#default-router 192.168.20.1
switch(dhcp-vlan20-config)#exit

四、网页配置步骤
1 、创建 VLAN 10

2、 将端口 ETH 1/0/1 加入 VLAN 10

3、 为 VLAN 10 分配接口 IP


4、 创建 VLAN20

5、 将端口 ETH 1/0/2 加入 VLAN 20

6 、为 VLAN20 分配接口 IP


7 、启用 DHCP SERVER 功能

8 、创建 VLAN 10 地址池



9、 创建 VLAN20 地址池


ICP备案号:晋ICP备18007549号-1
站长微信:13613567205