华为三层交换机 配置

news/2025/1/16 11:10:34/

1、拓扑图

 2、汇聚层交换机设置

<Huawei>sys
[Huawei]undo in en
[Huawei]sys SW2# 开启 DHCP
[SW2]dhcp enable# 创建 VLAN
[SW2]vlan batch 10 20 100# 设置 VLAN
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]p l t
[SW2-GigabitEthernet0/0/1]p t a v 10 20
[SW2-GigabitEthernet0/0/1]int g0/0/2
[SW2-GigabitEthernet0/0/2]p l t
[SW2-GigabitEthernet0/0/2]p t a v 10 20
[SW2-GigabitEthernet0/0/2]int g0/0/3
[SW2-GigabitEthernet0/0/3]p l a
[SW2-GigabitEthernet0/0/3]p d v 100# 设置 DHCP
[SW2-GigabitEthernet0/0/3]int vlanif 10
[SW2-Vlanif10]ip addr 192.168.10.1 24
[SW2-Vlanif10]dhcp select int
[SW2-Vlanif10]dhcp server dns-list 8.8.8.8[SW2-Vlanif10]int vlanif 20
[SW2-Vlanif20]ip addr 192.168.20.1 24
[SW2-Vlanif20]dhcp select int
[SW2-Vlanif20]dhcp server dns-list 114.114.114.114[SW2-Vlanif20]int vlanif 100
[SW2-Vlanif100]ip addr 100.0.0.1 24# 设置静态路由
[SW2-Vlanif100]ip route-static 0.0.0.0 0.0.0.0 100.0.0.2

3、接入层交换机设置

SW3

<Huawei>sys
[Huawei]undo in en
[Huawei]sys SW3
[SW3]vlan batch 10 20
[SW3]int e0/0/1
[SW3-Ethernet0/0/1]p l a
[SW3-Ethernet0/0/1]p d v 10
[SW3-Ethernet0/0/1]int e0/0/2
[SW3-Ethernet0/0/2]p l a
[SW3-Ethernet0/0/2]p d v 20
[SW3-Ethernet0/0/2]int e0/0/3
[SW3-Ethernet0/0/3]p l t
[SW3-Ethernet0/0/3]p t a v 10 20

SW4 

<Huawei>sys
[Huawei]undo in en
[Huawei]sys SW4
[SW4]vlan batch 10 20
[SW4]int e0/0/1
[SW4-Ethernet0/0/1]p l a
[SW4-Ethernet0/0/1]p d v 10
[SW4-Ethernet0/0/1]int e0/0/2
[SW4-Ethernet0/0/2]p l a
[SW4-Ethernet0/0/2]p d v 20
[SW4-Ethernet0/0/2]int e0/0/3
[SW4-Ethernet0/0/3]p l t
[SW4-Ethernet0/0/3]p t a v 10 20

4、核心层交换机设置

<Huawei>sys
[Huawei]undo in en
[Huawei]sys SW1# 创建 VLAN
[SW1]vlan batch 100 200
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]p l a
[SW1-GigabitEthernet0/0/1]p d v 100
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]p l a
[SW1-GigabitEthernet0/0/2]p d v 200# 设置 VLANIF 地址
[SW1-GigabitEthernet0/0/2]int vlanif 100
[SW1-Vlanif100]ip addr 100.0.0.2 24
[SW1-Vlanif100]int vlanif 200
[SW1-Vlanif200]ip addr 200.0.0.1 24# 设置静态路由
[SW1]ip route-static 192.168.10.0 24 100.0.0.1
[SW1]ip route-static 192.168.20.0 24 100.0.0.1

5、出口路由设置

<Huawei>sys
[Huawei]undo in en
[Huawei]sys R1# 配置地址
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip addr 200.0.0.2 24# 设置静态路由
[R1]ip route-static 192.168.10.0 24 200.0.0.1
[R1]ip route-static 192.168.20.0 24 200.0.0.1
[R1]ip route-static 100.0.0.0 24 200.0.0.1

6、测试

PC1获取IP

PC1>ipconfigLink local IPv6 address...........: fe80::5689:98ff:fe2a:e09
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.10.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.10.1
Physical address..................: 54-89-98-2A-0E-09
DNS server........................: 8.8.8.8

PC2获取IP

PC2>ipconfigLink local IPv6 address...........: fe80::5689:98ff:fee3:6765
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.20.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.20.1
Physical address..................: 54-89-98-E3-67-65
DNS server........................: 114.114.114.114

PC3获取IP

PC3>ipconfigLink local IPv6 address...........: fe80::5689:98ff:fee0:6bfa
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.10.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.10.1
Physical address..................: 54-89-98-E0-6B-FA
DNS server........................: 8.8.8.8

PC4获取IP

PC4>ipconfigLink local IPv6 address...........: fe80::5689:98ff:fe52:12f3
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.20.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.20.1
Physical address..................: 54-89-98-52-12-F3
DNS server........................: 114.114.114.114

PC1连通出口路由器

PC1>ping 200.0.0.2Ping 200.0.0.2: 32 data bytes, Press Ctrl_C to break
From 200.0.0.2: bytes=32 seq=1 ttl=253 time=78 ms
From 200.0.0.2: bytes=32 seq=2 ttl=253 time=94 ms
From 200.0.0.2: bytes=32 seq=3 ttl=253 time=62 ms
From 200.0.0.2: bytes=32 seq=4 ttl=253 time=63 ms
From 200.0.0.2: bytes=32 seq=5 ttl=253 time=93 ms--- 200.0.0.2 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 62/78/94 ms

http://www.ppmy.cn/news/116761.html

相关文章

H3C三层交换机配置DHCP

H3C三层交换机配置DHCP 1、建立vlan ,配置vlan接口 [SW01]vlan 11 [SW01-vlan11]port GigabitEthernet 1/0/1 #将端口加入vlan [SW01-vlan11]vlan 22 [SW01-vlan22]port GigabitEthernet 1/0/2 [SW01-vlan22]quit [SW01]interface Vlan-interface 11 #进入vlan接口 [SW01-V…

H3C系列之三层交换机系统版本升级

本文涉及到的硬件与软件交换机&#xff1a;H3C S3600-28TP-SItftp软件&#xff1a;tftpd32小软件升级的文件&#xff1a;S36SI_E-CMW310-R1702P44.zip 关于升级的文件说明如下&#xff1a; S36SI_E-CMW310-R1702P44-S168.bin 168-bit SSH encryption applicationS3600_…

H3C交换机配置链路聚合二层\三层

二层聚合&#xff1a; 一、静态聚合 [SW]int Bridge-Aggregation 1 [SW-Ethernet1/0/1]port link-aggregation group 1 [SW-Ethernet1/0/2]port link-aggregation group 1 [SW-Bridge-Aggregation1]port link-type trunk [SW-Bridge-Aggregation1]port trunk permit vl…

【三层交换技术】交换机

文章目录 1.三层交换机1.1 三层交换机简介1.2 二层交换机作用1.3 三层交换技术 2.三层交换机的转发原理2.1 一次路由&#xff0c;多次交换2.2 VLANIF虚接口2.3 三层交换机转发数据过程 3.实验&#xff1a;实现主机PC1与主机PC2互通4.总结 1.三层交换机 1.1 三层交换机简介 三…

三层交换机和二层交换机的区别 如何选择第三层交换机

二层交换机和三层交换机的区别 二层交换机用于小型的局域网络。这个就不用多言了&#xff0c;在小型局域网中&#xff0c;广播包影响不大&#xff0c;二层交换机的快速交换功能、多个接入端口和低谦价格为小型网络用户提供了很完善的解决方案。 三层交换机的优点在于接口类型…

(三层交换机+两层交换机)路由配置

目录 一、前言 二、目标拓扑图 三、硬软件 四、构思 五、实施 &#xff08;1&#xff09;看拓扑图配置 &#xff08;2&#xff09;三层交换机上进行配置 &#xff08;3&#xff09;左端交换机 &#xff08;4&#xff09;右端交换机 &#xff08;5&#xff09;验证 &a…

华为交换机三层交换机与二层交换机联合配置

1、现学现卖&#xff0c;学了就得用上 2、环境描述 1&#xff09;核心交换机S5700&#xff08;华为&#xff09; 2&#xff09;接入交换机S3700&#xff08;华为&#xff09; 3、要求 1&#xff09;不同vlan之间不能相互访问&#xff0c;每个vlan只能属于一个部门 2&…

二层交换机和三层交换机

二层交换机 二层交换机是数据链路层设备&#xff0c;由于它工作于OSI模型的第2层&#xff0c;可别数据包中的MAC地址信息&#xff0c;根据MAC地址进行转发&#xff0c;并将这些MAC地址与对应的端口记录在自己内部的一个地址表中。 三层交换机 三层交换机工作于OSI模型的第三层…