华为的基础配置综合,你会了吗?
1.实验拓扑:
使用ENSP模拟器(版本V100R002C001.2.00.370)
2.实验需求:
(1)划分vlan,C1和C3属于一个vlan,C2和C4属于一个vlan
(2)SW1分别和SW2,R1做链路捆绑
(3)在R1上做单臂路由配置vlan10,vlan20的网关
(4)PC通过DHCP获得IP地址
(5)用Ping命令检测全网的互通性
3.相关配置:
根据实验需求,对LSW进行配置
LSW1:
[Huawei]vlan bat 10 20(vlan bat可以同时添加多个vlan)
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port hybrid pvid vlan 10
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 10
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port hybrid pvid vlan 20
[Huawei-Ethernet0/0/2]port hybrid untagged vlan 20
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]trunkport Ethernet 0/0/10 0/0/11(对Eth-Trunk1做中继)
[Huawei-Eth-Trunk1]port hybrid tagged vlan 10 20
[Huawei]int Eth-Trunk 2
[Huawei-Eth-Trunk2]trunkport GigabitEthernet 0/0/1 0/0/2
[Huawei-Eth-Trunk2]port hybrid tagged vlan 10 20(因为Eth-Trunk2为上行口,同样需要做成中继)
检查vlan的配置结果:display vlan
LSW2:
[Huawei]vlan bat 10 20
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]port hybrid pvid vlan 10
[Huawei-Ethernet0/0/3]port hybrid untagged vlan 10
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]port hybrid pvid vlan 20
[Huawei-Ethernet0/0/4]port hybrid untagged vlan 20
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]trunkport Ethernet 0/0/10 0/0/11
[Huawei-Eth-Trunk1]port hybrid tagged vlan 10 20
检查vlan的配置结果:
以上是LSW-vlan的划分配置以及链路捆绑。根据实验的需求,还需要在路由器上做单臂路由,DHCP以及链路捆绑的配置。
具体配置:
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]undo portswitch(当两层设备和三层设备捆绑时,这是关键的一个命令。切不能忘记!!!)
[Huawei-Eth-Trunk1]int g0/0/1
[Huawei-GigabitEthernet0/0/1]eth-trunk 1
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]eth-trunk 1
[Huawei]int Eth-Trunk 1.10
[Huawei-Eth-Trunk1.10]dot1q termination vid 10
[Huawei-Eth-Trunk1.10]ip add 192.168.10.1 24
[Huawei-Eth-Trunk1.10]arp broadcast enable
[Huawei]int Eth-Trunk 1.20
[Huawei-Eth-Trunk1.20]dot1q termination vid 20
[Huawei-Eth-Trunk1.20]ip add 192.168.20.1 24
[Huawei-Eth-Trunk1.20]arp broadcast enable
[Huawei]dhcp enable
[Huawei]int Eth-Trunk 1.10
[Huawei-Eth-Trunk1.10]dhcp select interface
[Huawei]int Eth-Trunk 1.20
[Huawei-Eth-Trunk1.20]dhcp select interface
在这里我并没有配置DNS服务,在现实的网络中还是要配置DNS的。下面用DHCP测试一下PC是否可以获取到ip地址,如图:
ip地址已经通过DHCP自动获得,我们可以发现我们用了一条dhcp select interface的命令获得了三个参数。ip地址,子网掩码,网关都获取了。
下面我们测试全网的互通性,如图:
配置完成且实现全网互通。