网络综合实验小结(BGP、DHCP、DHCP中继、EasyIp、NAT-Server、VRRP、MSTP、RIP、OSPF、BGP路径属性选路、BGP手动路由聚合、链路聚合、路由重分发)

网络综合实验小结(BGP、DHCP、DHCP中继、EasyIp、NAT-Server、VRRP、MSTP、RIP、OSPF、BGP路径属性选路、BGP手动路由聚合、链路聚合、路由重分发)


前言

在这里插入图片描述

一、需求

  • 链路聚合
    SW1和SW2之间使用链路聚合互连,要求2条活跃,1条备用。
    使用dis trunkmembership eth-trunk 1 验证结果。

  • MSTP
    正常情况下各VLAN流量路径要求如下:
    VLAN10:SW3->SW1->R1;VLAN20:SW3->SW1->R1;VLAN30:SW4->SW2->R1;VLAN40:SW4->SW2->R1。
    使用dis stp brief 验证结果。

  • VRRP
    正常情况下要求VLAN10、VLAN20的Master为SW1;VLAN30、VLAN40的Master为SW2。
    使用dis vrrp 验证结果。

  • DHCP
    R5为DHCP服务器,R6为DHCP中继代理,要求R5和R6之间使用静态路由为PC5、PC6提供动态分配IP服务。
    在PC5、PC6使用ipconfig 验证结果。

  • 路由重分发
    R5和R6同在AS 200中,R5为OSPF的ASBR,而R6为外部路由,要求使用路由重分发使得AS 200全网段互通。
    在R5使用dis cu ,在R3 使用dis ip routing-table 验证结果。

  • BGP互通
    通过BGP实现1.1.1.1可以访问5.5.5.5
    在R1 使用dis bgp routing-table 和 ping -a 1.1.1.1 5.5.5.5 验证结果。

  • BGP路径属性选路
    通过BGP路径属性实现数据传输路径为 R1->R2->R4->R5->R6->R5->R3->R2->R1
    在R2和R5 使用dis bgp routing-table 验证结果。

  • NAT
    使用EasyIp进行转换使得Client1能够使用R1的g0/0/2接口的IP访问外网(10分); 使用NAT-Server使得Client1访问Server1的web服务时能够使用R6的g0/0/1接口的IP和8080端口进行访问
    在R1 使用display nat session all ,客户端访问http://56.0.0.6:8080 验证结果。

  • 所有终端能够网络互通
    要求PC2能够ping 通PC3和PC4;PC4能够ping 通PC5和Server1
    使用ping 验证结果。

  • 在R1使用BGP手动路由聚合,对192.168.1.0/24、192.168.2.0/24、192.168.3.0/24、192.168.4.0/24 进行地址汇总,实现其它路由器只接收到R1的聚合路由,而没有明细路由,从而防止其中某条明细路由出现丢失或震荡的情况,网络中的其它路由器也会删除或震荡。
    使用dis bgp routing-table 验证结果。

二、实验步骤(代码较多,原版简写代码)

1、端口IP配置及STP、VRRP、链路聚合

LSW1

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user- con 0
[Huawei-ui-console0]id 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20 30 40 100
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p l t
[Huawei-GigabitEthernet0/0/1]p t a v a
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]p l t
[Huawei-GigabitEthernet0/0/2]p t a v a
[Huawei-GigabitEthernet0/0/2]int g0/0/6
[Huawei-GigabitEthernet0/0/6]p l a 
[Huawei-GigabitEthernet0/0/6]p d v 100
[Huawei-GigabitEthernet0/0/6]int loop 0
[Huawei-LoopBack0]ip add 7.7.7.7 32
[Huawei-LoopBack0]q
[Huawei]int vlan 10
[Huawei-Vlanif10]ip add 192.168.1.10 24
[Huawei-Vlanif10]int vlan 20
[Huawei-Vlanif20]ip add 192.168.2.10 24
[Huawei-Vlanif20]int vlan 30
[Huawei-Vlanif30]ip add 192.168.3.10 24
[Huawei-Vlanif30]int vlan 40
[Huawei-Vlanif40]ip add 192.168.4.10 24
[Huawei-Vlanif40]int vlan 100
[Huawei-Vlanif100]ip add 10.0.0.10 24
[Huawei-Vlanif100]q
[Huawei]stp m mstp
[Huawei]stp re
[Huawei-mst-region]re huawei
[Huawei-mst-region]rev 1
[Huawei-mst-region]ins 1 vlan 10 20
[Huawei-mst-region]ins 2 vlan 30 40
[Huawei-mst-region]act re
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-mst-region]q
[Huawei]stp ins 1 root pri
[Huawei]stp ins 2 root sec
[Huawei]int vlan 10
[Huawei-Vlanif10]vrrp vrid 10 virtual-ip 192.168.1.1
[Huawei-Vlanif10]vrrp vrid 10 priority 105
[Huawei-Vlanif10]vrrp vrid 10 track interface GigabitEthernet0/0/6
[Huawei-Vlanif10]int vlan 20
[Huawei-Vlanif20]vrrp vrid 20 virtual-ip 192.168.2.1
[Huawei-Vlanif20]vrrp vrid 20 priority 105
[Huawei-Vlanif20]vrrp vrid 20 track interface GigabitEthernet0/0/6
[Huawei-Vlanif20]int vlan 30
[Huawei-Vlanif30] vrrp vrid 30 virtual-ip 192.168.3.1
[Huawei-Vlanif30]int vlan 40
[Huawei-Vlanif40]vrrp vrid 40 virtual-ip 192.168.4.1
[Huawei-Vlanif40]int eth-tr 1
[Huawei-Eth-Trunk1]bpdu enable
[Huawei-Eth-Trunk1]mode lacp-static
[Huawei-Eth-Trunk1]max active-linknumber 2
[Huawei-Eth-Trunk1]p l t
[Huawei-Eth-Trunk1]p t a v a
[Huawei-Eth-Trunk1]int g0/0/3
[Huawei-GigabitEthernet0/0/3]eth-tr 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-GigabitEthernet0/0/3]int g0/0/4
[Huawei-GigabitEthernet0/0/4]eth-tr 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-GigabitEthernet0/0/4]int g0/0/5
[Huawei-GigabitEthernet0/0/5]eth-tr 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-GigabitEthernet0/0/5]nds. Please wait for a moment...done.

LSW2

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user- con 0
[Huawei-ui-console0]id 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20 30 40 100
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p l t
[Huawei-GigabitEthernet0/0/1]p t a v a
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]p l t
[Huawei-GigabitEthernet0/0/2]p t a v a
[Huawei-GigabitEthernet0/0/2]int g0/0/6
[Huawei-GigabitEthernet0/0/6]p l a
[Huawei-GigabitEthernet0/0/6]p d v 100
[Huawei-GigabitEthernet0/0/6]int loop 0
[Huawei-LoopBack0]ip add 8.8.8.8 32
[Huawei-LoopBack0]q
[Huawei]int vlan 10
[Huawei-Vlanif10]ip add 192.168.1.20 24
[Huawei-Vlanif10]int vlan 20
[Huawei-Vlanif20]ip add 192.168.2.20 24
[Huawei-Vlanif20]int vlan 30
[Huawei-Vlanif30]ip add 192.168.3.20 24
[Huawei-Vlanif30]int vlan 40
[Huawei-Vlanif40]ip add 192.168.4.20 24
[Huawei-Vlanif40]int vlan 100
[Huawei-Vlanif100]ip add 11.0.0.20 24
[Huawei-Vlanif100]q
[Huawei]stp m mstp
[Huawei]stp re
[Huawei-mst-region]re huawei
[Huawei-mst-region]rev 1
[Huawei-mst-region]ins 1 vlan 10 20
[Huawei-mst-region]ins 2 vlan 30 40
[Huawei-mst-region]act re
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-mst-region]q
[Huawei]stp ins 1 root sec
[Huawei]stp ins 2 root pri
[Huawei]int vlan 10
[Huawei-Vlanif10]vrrp vrid 10 virtual-ip 192.168.1.1
[Huawei-Vlanif10]int vlan 20
[Huawei-Vlanif20]vrrp vrid 20 virtual-ip 192.168.2.1
[Huawei-Vlanif20]int vlan 30
[Huawei-Vlanif30]vrrp vrid 30 virtual-ip 192.168.3.1
[Huawei-Vlanif30] vrrp vrid 30 priority 105
[Huawei-Vlanif30]vrrp vrid 30 track interface GigabitEthernet0/0/6
[Huawei-Vlanif30]int vlan 40
[Huawei-Vlanif40]vrrp vrid 40 virtual-ip 192.168.4.1
[Huawei-Vlanif40]vrrp vrid 40 priority 105
[Huawei-Vlanif40] vrrp vrid 40 track interface GigabitEthernet0/0/6
[Huawei-Vlanif40]int eth-tr 1
[Huawei-Eth-Trunk1]bpdu enable
[Huawei-Eth-Trunk1]mode lacp-static
[Huawei-Eth-Trunk1]max active-linknumber 2
[Huawei-Eth-Trunk1]p l t
[Huawei-Eth-Trunk1]p t a v a
[Huawei-Eth-Trunk1]int g0/0/3
[Huawei-GigabitEthernet0/0/3]eth-tr 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-GigabitEthernet0/0/3]int g0/0/4
[Huawei-GigabitEthernet0/0/4]eth-tr 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-GigabitEthernet0/0/4]int g0/0/5
[Huawei-GigabitEthernet0/0/5]eth-tr 1
Info: This operation may take a few seconds. Please wait for a moment...done.

LSW3

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user- con 0
[Huawei-ui-console0]id 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l a
[Huawei-Ethernet0/0/1]p d v 10
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l a
[Huawei-Ethernet0/0/2]p d v 20
[Huawei-Ethernet0/0/2]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p l t
[Huawei-GigabitEthernet0/0/1]p t a v a
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]p l t
[Huawei-GigabitEthernet0/0/2]p t a v a
[Huawei-GigabitEthernet0/0/2]q
[Huawei]stp m mstp
[Huawei]stp re
[Huawei-mst-region]re huawei
[Huawei-mst-region]rev 1
[Huawei-mst-region]ins 1 vlan 10 20
[Huawei-mst-region]ins 2 vlan 30 40
[Huawei-mst-region]act re
Info: This operation may take a few seconds. Please wait for a moment...done.

LSW4

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user- con 0
[Huawei-ui-console0]id 0 0
[Huawei-ui-console0]q
[Huawei]vlan bat 30 40
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l a
[Huawei-Ethernet0/0/1]p d v 30
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l a
[Huawei-Ethernet0/0/2]p d v 40
[Huawei-Ethernet0/0/2]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p l t
[Huawei-GigabitEthernet0/0/1]p t a v a
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]p l t
[Huawei-GigabitEthernet0/0/2]p t a v a
[Huawei-GigabitEthernet0/0/2]q
[Huawei]stp m mstp
[Huawei]stp re
[Huawei-mst-region]re huawei
[Huawei-mst-region]rev 1
[Huawei-mst-region]ins 1 vlan 10 20
[Huawei-mst-region]ins 2 vlan 30 40
[Huawei-mst-region]act re
Info: This operation may take a few seconds. Please wait for a moment...done.

R1

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user- con 0
[Huawei-ui-console0]id 0 0
[Huawei-ui-console0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add  11.0.0.1 24
[Huawei-GigabitEthernet0/0/1]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 10.0.0.1 24
[Huawei-GigabitEthernet0/0/0]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 12.0.0.1 24
[Huawei-GigabitEthernet0/0/2]int loop0
[Huawei-LoopBack0]ip add 1.1.1.1 32

R2

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user- con 0
[Huawei-ui-console0]id  0 0
[Huawei-ui-console0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 23.0.0.2 24
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 24.0.0.2 24
[Huawei-GigabitEthernet0/0/2]int loop 0
[Huawei-LoopBack0]ip add 2.2.2.2 32
[Huawei-LoopBack0]q
[Huawei]ip route-s 3.3.3.3 32 23.0.0.3
[Huawei]ip route-s 4.4.4.4 32 24.0.0.4

R3

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user- con 0
[Huawei-ui-console0]id 0 0
[Huawei-ui-console0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 23.0.0.3 24
[Huawei-GigabitEthernet0/0/1]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 35.0.0.3 24
[Huawei-GigabitEthernet0/0/0]int loop0
[Huawei-LoopBack0]ip add 3.3.3.3 32
[Huawei-LoopBack0]q
[Huawei]ip route-s 2.2.2.2 32 23.0.0.2

R4

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user- con 0
[Huawei-ui-console0]id 0 0
[Huawei-ui-console0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 45.0.0.4 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 24.0.0.4 24
[Huawei-GigabitEthernet0/0/2]int loop 0
[Huawei-LoopBack0]ip add 4.4.4.4 32
[Huawei-LoopBack0]q
[Huawei]ip route-s 2.2.2.2 32 24.0.0.2

R5

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user- con 0
[Huawei-ui-console0]id 0 0
[Huawei-ui-console0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 35.0.0.5 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 56.0.0.5 24
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 45.0.0.5 24
[Huawei-GigabitEthernet0/0/2]int loop0
[Huawei-LoopBack0]ip add 5.5.5.5 32
[Huawei-LoopBack0]q
[Huawei]ip route-s 6.6.6.6 32 56.0.0.6
[Huawei]ip route-s 192.168.5.0 24 56.0.0.6
[Huawei]ip route-s 192.168.6.0 24 56.0.0.6

R6

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user- con 0
[Huawei-ui-console0]id 0 0
[Huawei-ui-console0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 56.0.0.6 24
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 192.168.5.1 24
[Huawei-GigabitEthernet0/0/2]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.6.1 24
[Huawei-GigabitEthernet0/0/0]int loop0
[Huawei-LoopBack0]ip add 6.6.6.6 32
[Huawei-LoopBack0]q
[Huawei]ip route-s 0.0.0.0 0 56.0.0.5

2、RIP及OSPF配置

LSW1

[Huawei]rip
[Huawei-rip-1]v 2
[Huawei-rip-1]undo sum
[Huawei-rip-1]net 7.0.0.0
[Huawei-rip-1]net 10.0.0.0
[Huawei-rip-1]net 192.168.1.0
[Huawei-rip-1]net 192.198.2.0

LSW2

[Huawei]rip
[Huawei-rip-1]v 2
[Huawei-rip-1]undo sum
[Huawei-rip-1]net 8.0.0.0
[Huawei-rip-1]net 11.0.0.0
[Huawei-rip-1]net 192.168.3.0
[Huawei-rip-1]net 192.168.4.0

R1

[Huawei]rip 1
[Huawei-rip-1]v 2
[Huawei-rip-1]undo sum
[Huawei-rip-1]net 1.0.0.0
[Huawei-rip-1]net 10.0.0.0
[Huawei-rip-1]net 11.0.0.0
[Huawei-rip-1]net 12.0.0.0

R2

[Huawei]rip 1
[Huawei-rip-1]v 2
[Huawei-rip-1]undo sum
[Huawei-rip-1]net 12.0.0.0
[Huawei-rip-1]net 2.0.0.0

R3

[Huawei]ospf 1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net 3.3.3.3 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]net 35.0.0.0 0.0.0.255

R4

[Huawei]ospf 1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net 4.4.4.4 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]net 45.0.0.0 0.0.0.255

R5

[Huawei]ospf 1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net 5.5.5.5 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]net 35.0.0.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]net 45.0.0.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]q
[Huawei-ospf-1]import-route static
[Huawei-ospf-1]default-route-advertise always
[Huawei-ospf-1]import-route direct

3、DHCP及DHCP中继

R5

[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool 1
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-1]gateway-list 192.168.6.1
[Huawei-ip-pool-1]net 192.168.6.1 mask 255.255.255.0
[Huawei-ip-pool-1]dns-list 8.8.8.8
[Huawei-ip-pool-1]lease day 10
[Huawei-ip-pool-1]int g0/0/1
[Huawei-GigabitEthernet0/0/1]dhcp select glo

R6

[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select relay
[Huawei-GigabitEthernet0/0/0]dhcp relay server-ip 56.0.0.5

4、BGP

LSW1

[Huawei]bgp 100
[Huawei-bgp]router-id 7.7.7.7
[Huawei-bgp]peer 1.1.1.1 as-n 100
[Huawei-bgp]peer 2.2.2.2 as-n 100
[Huawei-bgp]peer 8.8.8.8 as-n 100
[Huawei-bgp]peer 1.1.1.1 con loop0
[Huawei-bgp]peer 2.2.2.2 con loop0
[Huawei-bgp]peer 8.8.8.8 con loop0
[Huawei-bgp]net 7.7.7.7 32
[Huawei-bgp]net 8.8.8.8 32
[Huawei-bgp]net 1.1.1.1 32
[Huawei-bgp]net 2.2.2.2 32

LSW2

[Huawei]bgp 100
[Huawei-bgp]router-id 8.8.8.8
[Huawei-bgp]peer 1.1.1.1 as-n 100
[Huawei-bgp]peer 2.2.2.2 as-n 100
[Huawei-bgp]peer 7.7.7.7 as-n 100
[Huawei-bgp]peer 1.1.1.1 con loop0
[Huawei-bgp]peer 2.2.2.2 con loop0
[Huawei-bgp]peer 7.7.7.7 con loop0
[Huawei-bgp]net 1.1.1.1 32
[Huawei-bgp]net 2.2.2.2 32
[Huawei-bgp]net 7.7.7.7 32
[Huawei-bgp]net 8.8.8.8 32

R1

[Huawei]bgp 100
[Huawei-bgp]router-id 1.1.1.1
[Huawei-bgp]peer 2.2.2.2 as-n 100
[Huawei-bgp]peer 7.7.7.7 as-n 100
[Huawei-bgp]peer 8.8.8.8 as-n 100
[Huawei-bgp]peer 2.2.2.2 con loop0
[Huawei-bgp]peer 7.7.7.7 con loop0
[Huawei-bgp]peer 8.8.8.8 con loop0
[Huawei-bgp]net 1.1.1.1 32
[Huawei-bgp]net 2.2.2.2 32
[Huawei-bgp]net 7.7.7.7 32
[Huawei-bgp]net 8.8.8.8 32

R2

[Huawei]bgp 100
[Huawei-bgp]router-id 2.2.2.2
[Huawei-bgp]peer 1.1.1.1 as-n 100
[Huawei-bgp]peer 7.7.7.7 as-n 100
[Huawei-bgp]peer 8.8.8.8 as-n 100
[Huawei-bgp]peer 1.1.1.1 con loop0
[Huawei-bgp]peer 7.7.7.7 con loop0
[Huawei-bgp]peer 8.8.8.8 con loop0
[Huawei-bgp]peer 3.3.3.3 as-n 200
[Huawei-bgp]peer 4.4.4.4 as-n 200
[Huawei-bgp]peer 3.3.3.3 con loop0
[Huawei-bgp]peer 4.4.4.4 con loop0
[Huawei-bgp]peer 1.1.1.1 next-hop-local 
[Huawei-bgp]peer 7.7.7.7 next-hop-local 
[Huawei-bgp]peer 8.8.8.8 next-hop-local 
[Huawei-bgp]peer 3.3.3.3 ebgp-max-hop 2
[Huawei-bgp]peer 4.4.4.4 ebgp-max-hop 2
[Huawei-bgp]net 1.1.1.1 32
[Huawei-bgp]net 2.2.2.2 32
[Huawei-bgp]net 7.7.7.7 32
[Huawei-bgp]net 8.8.8.8 32
[Huawei-bgp]net 3.3.3.3 32
[Huawei-bgp]net 4.4.4.4 32
[Huawei-bgp]net 192.168.2.0 24
[Huawei-bgp]net 192.168.1.0 24
[Huawei-bgp]net 192.168.3.0 24
[Huawei-bgp]net 192.168.4.0 24

R3

[Huawei]bgp 200
[Huawei-bgp]router-id 3.3.3.3
[Huawei-bgp]peer 2.2.2.2 as-n 100
[Huawei-bgp]peer 4.4.4.4 as-n 200
[Huawei-bgp]peer 5.5.5.5 as-n 200
[Huawei-bgp]peer 6.6.6.6 as-n 200
[Huawei-bgp]peer 2.2.2.2 con loop0
[Huawei-bgp]peer 4.4.4.4 con loop0
[Huawei-bgp]peer 5.5.5.5 con loop0
[Huawei-bgp]peer 6.6.6.6 con loop0
[Huawei-bgp]peer 2.2.2.2 ebgp-max-hop 2
[Huawei-bgp]peer 4.4.4.4 next-hop-local
[Huawei-bgp]peer 5.5.5.5 next-hop-local
[Huawei-bgp]peer 6.6.6.6 next-hop-local
[Huawei-bgp]net 2.2.2.2 32
[Huawei-bgp]net 3.3.3.3 32
[Huawei-bgp]net 4.4.4.4 32
[Huawei-bgp]net 5.5.5.5 32
[Huawei-bgp]net 6.6.6.6 32
[Huawei-bgp]net 192.168.5.0 24
[Huawei-bgp]net 192.168.6.0 24

R4

[Huawei]bgp 200
[Huawei-bgp]router-id 4.4.4.4
[Huawei-bgp]peer 3.3.3.3 as-n 200
[Huawei-bgp]peer 2.2.2.2 as-n 100
[Huawei-bgp]peer 5.5.5.5 as-n 200
[Huawei-bgp]peer 6.6.6.6 as-n 200
[Huawei-bgp]peer 2.2.2.2 con loop0
[Huawei-bgp]peer 3.3.3.3 con loop0
[Huawei-bgp]peer 5.5.5.5 con loop0
[Huawei-bgp]peer 6.6.6.6 con loop0
[Huawei-bgp]peer 2.2.2.2 ebgp-max-hop 2
[Huawei-bgp]peer 3.3.3.3 next-hop-local
[Huawei-bgp]peer 5.5.5.5 next-hop-local
[Huawei-bgp]peer 6.6.6.6 next-hop-local
[Huawei-bgp]net 2.2.2.2 32
[Huawei-bgp]net 3.3.3.3 32
[Huawei-bgp]net 4.4.4.4 32
[Huawei-bgp]net 5.5.5.5 32
[Huawei-bgp]net 6.6.6.6 32
[Huawei-bgp]net 192.168.5.0 24
[Huawei-bgp]net 192.168.6.0 24

R5

[Huawei]bgp 200
[Huawei-bgp]router-id 5.5.5.5
[Huawei-bgp]peer 6.6.6.6 as-n 200
[Huawei-bgp]peer 3.3.3.3 as-n 200
[Huawei-bgp]peer 4.4.4.4 as-n 200
[Huawei-bgp]peer 6.6.6.6 con loop 0
[Huawei-bgp]peer 3.3.3.3 con loop0
[Huawei-bgp]peer 4.4.4.4 con loop0
[Huawei-bgp]peer 3.3.3.3 next-hop-local
[Huawei-bgp]peer 4.4.4.4 next-hop-local
[Huawei-bgp]peer 6.6.6.6 next-hop-local
[Huawei-bgp]net 3.3.3.3 32
[Huawei-bgp]net 4.4.4.4 32
[Huawei-bgp]net 5.5.5.5 32
[Huawei-bgp]net 6.6.6.6 32

R6

[Huawei]bgp 200
[Huawei-bgp]router-id 6.6.6.6
[Huawei-bgp]peer 3.3.3.3 as-number 200
[Huawei-bgp] peer 3.3.3.3 connect-interface LoopBack0
[Huawei-bgp] peer 4.4.4.4 as-number 200
[Huawei-bgp]peer 4.4.4.4 connect-interface LoopBack0
[Huawei-bgp]peer 5.5.5.5 as-number 200
[Huawei-bgp]peer 5.5.5.5 connect-interface LoopBack0
[Huawei-bgp] peer 3.3.3.3 next-hop-local 
[Huawei-bgp]peer 4.4.4.4 next-hop-local
[Huawei-bgp]peer 5.5.5.5 next-hop-local 
[Huawei-bgp]network 6.6.6.6 32
[Huawei-bgp]net 56.0.0.0 24

5、EasyIp与NAT-Server

R1

Huawei]acl number 3000 
[Huawei-acl-adv-3000]rule 5 permit ip source 192.168.10.0 0.0.0.255
[Huawei-acl-adv-3000]int g0/0/2
[Huawei-GigabitEthernet0/0/2]nat outbound 3000

R6

[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 8080 inside 192.168.5.1 www

6、BGP手动聚合

R1

[Huawei]ip route-static 192.168.0.0 255.255.248.0 null 0
[Huawei]bgp 100
[Huawei-bgp]net 192.168.0.0 255.255.248.0

7、BGP选路

R2

[Huawei]route-policy as permit node 10
Info: New Sequence of this List.
[Huawei-route-policy]apply as-path 123 123 additive
[Huawei-route-policy]q
[Huawei]bgp 100
[Huawei-bgp]peer 3.3.3.3 route-policy as import
[Huawei-bgp]q
[Huawei]q
<Huawei>refresh bgp all import

R3

[Huawei]route-policy lop permit node 10
Info: New Sequence of this List.
[Huawei-route-policy]apply local-preference 222
[Huawei-route-policy]q
[Huawei]bgp 200	
[Huawei-bgp]peer 5.5.5.5 route-policy lop export 
[Huawei-bgp]q
[Huawei]q
<Huawei>refresh bgp all export 

三、实验结果

在这里插入图片描述
在这里插入图片描述

LSW1举例

[Huawei]dis vrrp
  Vlanif10 | Virtual Router 10
    State : Master
    Virtual IP : 192.168.1.1
    Master IP : 192.168.1.10
    PriorityRun : 105
    PriorityConfig : 105
    MasterPriority : 105
    Preempt : YES   Delay Time : 0 s
    TimerRun : 1 s
    TimerConfig : 1 s
    Auth type : NONE
    Virtual MAC : 0000-5e00-010a
    Check TTL : YES
    Config type : normal-vrrp
    Track IF : GigabitEthernet0/0/6   Priority reduced : 10
    IF state : UP
    Create time : 2021-01-18 22:17:04 UTC-08:00
    Last change time : 2021-01-18 22:17:07 UTC-08:00

  Vlanif20 | Virtual Router 20
    State : Master
    Virtual IP : 192.168.2.1
    Master IP : 192.168.2.10
    PriorityRun : 105
    PriorityConfig : 105
    MasterPriority : 105
    Preempt : YES   Delay Time : 0 s
    TimerRun : 1 s
    TimerConfig : 1 s
    Auth type : NONE
    Virtual MAC : 0000-5e00-0114
    Check TTL : YES
    Config type : normal-vrrp
    Track IF : GigabitEthernet0/0/6   Priority reduced : 10
    IF state : UP
    Create time : 2021-01-18 22:17:54 UTC-08:00
    Last change time : 2021-01-18 22:17:58 UTC-08:00

  Vlanif30 | Virtual Router 30
    State : Backup
    Virtual IP : 192.168.3.1
    Master IP : 192.168.3.20
    PriorityRun : 100
    PriorityConfig : 100
    MasterPriority : 105
    Preempt : YES   Delay Time : 0 s
    TimerRun : 1 s
    TimerConfig : 1 s
    Auth type : NONE
    Virtual MAC : 0000-5e00-011e
    Check TTL : YES
    Config type : normal-vrrp
    Create time : 2021-01-18 22:18:26 UTC-08:00
    Last change time : 2021-01-18 22:19:40 UTC-08:00

  Vlanif40 | Virtual Router 40
    State : Backup
    Virtual IP : 192.168.4.1
    Master IP : 192.168.4.20
    PriorityRun : 100
    PriorityConfig : 100
    MasterPriority : 105
    Preempt : YES   Delay Time : 0 s
    TimerRun : 1 s
    TimerConfig : 1 s
    Auth type : NONE
    Virtual MAC : 0000-5e00-0128
    Check TTL : YES
    Config type : normal-vrrp
    Create time : 2021-01-18 22:18:39 UTC-08:00
    Last change time : 2021-01-18 22:20:11 UTC-08:00

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

总结

网络基础总结一篇,希望大家喜欢

猜你喜欢

转载自blog.csdn.net/Lucien010230/article/details/112798180
今日推荐