Network comprehensive experiment: vrrp vlan ospf rip link aggregation static routing dhcp nat and ospf redistribution

Network comprehensive experiment: vrrp vlan ospf rip link aggregation static routing dhcp nat and ospf redistribution

Insert picture description here
Configure the easy ip access server on the r1 interface G0/0/2. The
server is used as a NAT server on the private network. Configure
on the G0/0/0 interface of r3. Use sw1 as the main router of vlan20 and the main root of
sw2vlan10.
R2 configure the dhcp server
r3 configuration dhcp repeater, route injection, static route
r4 configure static route

sw1

u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw1
[sw1]user-interface console 0
[sw1-ui-console0]idle-timeout 0 0
[sw1-ui-console0]q
[sw1]vlan bat 10 20 100
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw1]int g0/0/01
[sw1-GigabitEthernet0/0/1]p l t
[sw1-GigabitEthernet0/0/1]p t a v a
[sw1-GigabitEthernet0/0/1]int g0/0/5
[sw1-GigabitEthernet0/0/5]p l a
[sw1-GigabitEthernet0/0/5]p d v 100
[sw1-GigabitEthernet0/0/5]q
[sw1]lacp priority 1000
[sw1]int eth-trunk 1
[sw1-Eth-Trunk1]bpdu enable
[sw1-Eth-Trunk1]mode lacp-static
[sw1-Eth-Trunk1]trunkport GigabitEthernet 0/0/2 to 0/0/4
Info: This operation may take a few seconds. Please wait for a moment…
[sw1]int Eth-Trunk 1
[sw1-Eth-Trunk1]p l t
[sw1-Eth-Trunk1]p t a v a
[sw1-Eth-Trunk1]max active-linknumber 2
[sw1-Eth-Trunk1]q
[sw1]stp mode mstp
[sw1]stp region-configuration
[sw1-mst-region]region-name huawei
[sw1-mst-region]rev
[sw1-mst-region]revision-level 1
[sw1-mst-region]instance 1 vlan 20
[sw1-mst-region]instance 2 vlan 10
[sw1-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw1-mst-region]q
[sw1]stp instance 1 root primary
[sw1]stp instance 2 root secondary
[sw1]int vlan 10
[sw1-Vlanif10]ip add 192.168.10.10 24
[sw1-Vlanif10]int vlan 20
[sw1-Vlanif20]ip add 192.168.20.10 24
[sw1-Vlanif20]int vlan 100
[sw1-Vlanif100]ip add 10.0.0.10 24
[sw1-Vlanif100]int vlan 10
[sw1-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.1
[sw1-Vlanif10]vrrp vrid 10 priority 115
[sw1-Vlanif10]int vlan 20
[sw1-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.1
[sw1-Vlanif20]vrrp vrid 20 priority 120
[sw1-Vlanif20]vrrp vrid 20 track interface g0/0/5 reduced 30
[sw1-Vlanif20]q
[sw1]ospf
[sw1-ospf-1]area 0
[sw1-ospf-1-area-0.0.0.0]network 10.0.0.0 0.0.0.255
[sw1-ospf-1-area-0.0.0.0]network 192.168.10.0 0.0.0.255
[sw1-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255

sw2

[Huawei]sysname sw2
[sw2]user-interface console 0
[sw2-ui-console0]idle-t
[sw2-ui-console0]idle-timeout 0 0
[sw2-ui-console0]q
[sw2]vlan bat 10 20 100
[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]p l t
[sw2-GigabitEthernet0/0/1]p t a v a
[sw2-GigabitEthernet0/0/1]int g0/0/5
[sw2-GigabitEthernet0/0/5]p l a
[sw2-GigabitEthernet0/0/5]p d v 100
[sw2-GigabitEthernet0/0/5]q
[sw2]lacp priority 1000
[sw2]int Eth-Trunk 1
[sw2-Eth-Trunk1]bpdu enable
[sw2-Eth-Trunk1]mode lacp-static
[sw2-Eth-Trunk1]trunkport GigabitEthernet 0/0/2 to 0/0/4
[sw2-Eth-Trunk1]p l t
[sw2-Eth-Trunk1]p t a v a
[sw2-Eth-Trunk1]max active-linknumber 2
[sw2-Eth-Trunk1]q
[sw2]stp region-configuration
[sw2-mst-region]region-name huawei
[sw2-mst-region]revision-level 1
[sw2-mst-region]instance 1 vlan 20
[sw2-mst-region]ins
[sw2-mst-region]instance 2 vlan 10
[sw2-mst-region]active region-configuration
[sw2-mst-region]q
[sw2]stp instance 1 root secondary
[sw2]stp instance 2 root primary
[sw2]int vlan 10
[sw2-Vlanif10]ip add 192.168.10.20 24
[sw2-Vlanif10]int vlan 20
[sw2-Vlanif20]ip add 192.168.20.20 24
[sw2-Vlanif20]int vlan 100
[sw2-Vlanif100]ip add 11.0.0.20 24
[sw2-Vlanif100]q
[sw2]int vlan 10
[sw2-Vlanif10]vrrp vrid 10 vr
[sw2-Vlanif10]vrrp vrid 10 vir
[sw2-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.1
[sw2-Vlanif10]vrrp vrid 10 pri
[sw2-Vlanif10]vrrp vrid 10 priority 120
[sw2-Vlanif10]vrrp vrid 10 track interface g0/0/5 reduced 30
[sw2-Vlanif10]int vlan 20
[sw2-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.1
[sw2-Vlanif20]vrrp vrid 20 priority 115
[sw2-Vlanif20]q
[sw2]dis vrrp

[sw2]
[sw2]ospf
[sw2-ospf-1]area 0
[sw2-ospf-1-area-0.0.0.0]network 11.0.0.0 0.0.0.255
[sw2-ospf-1-area-0.0.0.0]network 192.168.10.0 0.0.0.255
[sw2-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
[sw2-ospf-1-area-0.0.0.0]q
[sw2-ospf-1]q
[sw2]

sw3

Please Press ENTER.
u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw3
[sw3]vlan bat 10 20 100
Info: This operation may take a few seconds. Please wait for a moment…done.
[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 a
[sw3-Ethernet0/0/3]p d v 10
[sw3-Ethernet0/0/3]int g0/0/1
[sw3-GigabitEthernet0/0/1]p l t
[sw3-GigabitEthernet0/0/1]p t a v a
[sw3-GigabitEthernet0/0/1]int g0/0/2
[sw3-GigabitEthernet0/0/2]p l t
[sw3-GigabitEthernet0/0/2]p t a v a
[sw3]stp mode mstp
[sw3]stp region-configuration
[sw3-mst-region]region-name huawei
[sw3-mst-region]revision-level 1
[sw3-mst-region]instance 1 vlan 10
[sw3-mst-region]instance 2 vlan 20
[sw3-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw3-mst-region]

r1

u t m
[Huawei]sysname r1
[r1]user-interface console 0
[r1-ui-console0]idle-timeout 0 0
[r1-ui-console0]q
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 10.0.0.1 24
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 11.0.0.1 24
[r1-GigabitEthernet0/0/1]undo shutdown
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[r1-GigabitEthernet0/0/1]int g0/0/0
[r1-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[r1-GigabitEthernet0/0/0]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 12.0.0.1 24
[r1-GigabitEthernet0/0/2]undo shutdown
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[r1-GigabitEthernet0/0/2]q
[r1]ospf
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 10.0.0.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 11.0.0.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 12.0.0.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]q
[r1-ospf-1]q
[r1]int loop0
[r1-LoopBack0]ip add 1.1.1.1 32
[r1-LoopBack0]ospf
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]q
[r1]acl 2000
[r1-acl-basic-2000]rule per
[r1-acl-basic-2000]rule permit s
[r1-acl-basic-2000]rule permit source 192.168.10.101 0.0.0.255
[r1-acl-basic-2000]q
[r1]int g0/0/2
[r1-GigabitEthernet0/0/2]nat outbound 2000
[r1-GigabitEthernet0/0/2]q

r2

[Huawei]sysname r2
[r2]user-interface console 0
[r2-ui-console0]idle-timeout 0 0
[r2-ui-console0]q
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[r2-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[r2-GigabitEthernet0/0/0]int g0/0/2
[r2-GigabitEthernet0/0/2]ip add 24.0.0.2 24
[r2-GigabitEthernet0/0/2]undo shutdown
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[r2-GigabitEthernet0/0/2]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 23.0.0.2 24
[r2-GigabitEthernet0/0/1]undo shutdown
[r2-GigabitEthernet0/0/1]q
[r2]int loop0
[r2-LoopBack0]ip add 2.2.2.2 32
[r2-LoopBack0]ospf
[r2]dhcp enable
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ip pool 1
[r2-ip-pool-1]gateway-list 192.168.100.1
[r2-ip-pool-1]network 192.168.100.0 mask 24
[r2-ip-pool-1]dns-list 8.8.8.8
[r2-ip-pool-1]int g0/0/1
[r2-GigabitEthernet0/0/1]dhcp select global
[r2-GigabitEthernet0/0/1]q
[r2]ospf
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 12.0.0.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]q
[r2-ospf-1]q
[r2]rip
[r2-rip-1]version 2
[r2-rip-1]undo summary
[r2-rip-1]network 23.0.0.0
[r2-rip-1]import-route ospf 1 cost 3
[r2-rip-1]q
[r2]ospf
[r2-ospf-1]import-route rip 1 type 1 cost 1
[r2-ospf-1]q
[r2]ip route-static 192.168.30.0 24 24.0.0.4
[r2]ospf
[r2-ospf-1]import-route direct
[r2-ospf-1]import-route static
[r2]rip
[r2-ospf-1]default-route originate

r3

u t m
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r3
[r3]user-in
[r3]user-interface c
[r3]user-interface console0
[r3-ui-console0]idle-t
[r3-ui-console0]idle-timeout 0 0
[r3-ui-console0]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 23.0.0.1 24
[r3-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.100.1 24
[r3-GigabitEthernet0/0/1]undo shutdown
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[r3-GigabitEthernet0/0/1]int g0/0/2
[r3-GigabitEthernet0/0/2]ip add 192.168.50.1 24
[r3-GigabitEthernet0/0/2]undo shutdown
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[r3-GigabitEthernet0/0/2]q
[r3]dhcp enable
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]dhcp select relay
[r3-GigabitEthernet0/0/1]dhcp relay server-ip 23.0.0.2
[r3-GigabitEthernet0/0/1]q
[r3]q
[r3]int loop0
[r3-LoopBack0]ip add 3.3.3.3 32
[r3-LoopBack0]q
[r3]ospf
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]undo network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]q
[r3-ospf-1]q
[r3]rip
[r3-rip-1]version 2
[r3-rip-1]undo summary
[r3-rip-1]network 23.0.0.0
[r3-rip-1]network 192.168.100.0
[r3-rip-1]network 192.168.50.0
[r3-rip-1]network 3.0.0.0
[r3-rip-1]q
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]nat server protocol tcp global 23.0.0.3 8080 inside 192.168.50.100 80
[r3-GigabitEthernet0/0/0]dis this

r4

u t m
Info: Current terminal monitor is off.
sys
[Huawei]sysname r4
[r4]user-interface console 0
[r4-ui-console0]idle-timeout 0 0
[r4-ui-console0]q
[r4]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 24.0.0.4 24
[r4-GigabitEthernet0/0/2]q
[r4]ip route-static 0.0.0.0 0 24.0.0.2
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.30.1 24
[r4-GigabitEthernet0/0/0]undo shutdown

Guess you like

Origin blog.csdn.net/weixin_53567573/article/details/112717849
Recommended