Huawei router connection layer 3 switch configuration

Huawei router connection layer 3 switch configuration

lab environment

sw1 configuration:

[Huawei]dhcp enable //Enable the dhcp function
[Huawei]vlan batch 88 100 //Create vlan88 and vlan100
[Huawei]interface Vlanif 88 //Configure vlan88
[Huawei-Vlanif88]ip add 192.168.88.254 24 //Configure ip for vlan88
[Huawei-Vlanif88]dhcp select interface //Enable port dhcp function on vlan88
[Huawei]interface GigabitEthernet 0/0/1 //Configure port g0/0/1 connected to pc1
[Huawei-GigabitEthernet0/0/1]port link-type access //Set to access mode
[Huawei-GigabitEthernet0/0/1] port default vlan 88 //Divided to vlan88

Check whether pc1 has obtained the address
set dhcp
successfully obtained ip address
[Huawei] interface vlanif 100 configure vlan100
[Huawei-Vlanif100] ip add 10.10.10.253 24 configure ip address for vlan100
[Huawei] interface GigabitEthernet 0/0/24 configure port g0/0/24 connected to the router
[ Huawei-GigabitEthernet0/0/24]port link-type access Configure the port as access mode
[Huawei-GigabitEthernet0/0/24]port default vlan 100 Port is assigned to vlan100
[Huawei]ip route-static 0.0.0.0 0.0.0.0 10.10. 10.254 The Layer 3 switch is configured with a default route, and the next hop address is the port address of the connecting router

Router configuration:

[Huawei] interface GigabitEthernet 0/0/0 Configure port g0/0/0
[Huawei-GigabitEthernet0/0/0] ip add 10.10.10.254 24 Configure IP address
[Huawei-GigabitEthernet0/0/0] ip route-static 192.168. 88.0 255.0.0.0 10.10.10.253 set return route

So far, pc1 can ping the route.
Next, ping the public network device

[Huawei] interface GigabitEthernet 0/0/1 configure port g0/0/1
[Huawei-GigabitEthernet0/0/1] ip add 172.16.1.254 port 24 configure ip
Simulate public network device ip
[Huawei] acl 2001 Create a basic acl and name it 2001
[Huawei-acl -basic-2001]rule 10 permit source 192.168.88.0 0.0.0.255 The sequence is 10, allow, source ip
[Huawei]interface GigabitEthernet 0/0/1 Configure the internal network egress port g0/0/1
[Huawei-GigabitEthernet0/0/ 1] nat outbound 2001 set NAT export conversion acl 2001

So far, the intranet pc1 can ping the public network pc2
insert image description here

Guess you like

Origin blog.csdn.net/L_O_V_E8023/article/details/129141842