综合实行
一.实行拓扑:https://i-blog.csdnimg.cn/direct/cbc7a6d51b1b498aa279ce3a36023251.png
二.实行要求:
1、内网IP地点使用172.16.0.0/16分配。
2、SW1和SW2之间互为备份。
3、VRRP/STP/VLAN/Eth-trunk均使用。
4、所有PC通过DHCP获取IP地点。
5、ISP只能配置IP地点。
6、所有电脑可以正常访问ISP路由器。
三.实行分析:
一、IP 地点划分思绪:
[*]选择 172.16.0.0/16 作为私网地点段,是一个 B 类地点范围,有足够的地点空间进行子网划分以满足内部网络需求。
[*]172.16.2.0/24、172.16.3.0/24 分别分配给 VLAN 2 和 VLAN 3,用于内部差别业务或部门的网络隔离。
[*]172.16.4.0/24 和 172.16.5.0/24 用于毗连三层互换机(SW1、SW2)和路由器 R1,作为上行链路地点,便于装备之间的通讯和数据转发。
[*]100.0.0.0/24 作为公网地点段,用于路由器 R1 与 ISP 的毗连,实现内部网络对外部网络的访问。
二、配置顺序思绪:
[*]Eth-trunk(链路聚合):三层互换机之间配置聚合链路,增加链路带宽和可靠性,而且只做二层 VLAN 透传,确保 VLAN 数据能够在互换机之间正常传输。
[*]VLAN:在所有互换机上创建 VLAN 2 和 VLAN 3,并配置相应的 access 端口毗连终端装备(如 PC),trunk 端口用于毗连其他互换机或三层装备,实现 VLAN 间的通讯。
[*]MSTP(多天生树协议):通过创建 instance 2 和 instance 3 分别管理 VLAN 2 和 VLAN 3,指定 SW1 和 SW2 在差别 instance 中的主备角色,制止网络中出现环路,提高网络的稳定性和可靠性。
[*]SVI(互换假造接口):在三层互换机上创建四个 vlanif 接口,此中两个作为 VLAN 2 和 VLAN 3 的网关,为 VLAN 内的装备提供三层转发功能;别的两个作为上行链路接口,用于毗连路由器 R1。
[*]VRRP(假造路由器冗余协议):为 VLAN 2 和 VLAN 3 分别创建 VIP,指定 SW1 和 SW2 在差别 VLAN 中的主备角色,当主装备出现故障时,备份装备能够迅速继承,保证网络的连续性。
[*]DHCP(动态主机配置协议):在 R1 上创建两个地点池分别为 VLAN 2 和 VLAN 3 的装备分配 IP 地点,通过在 SW1 和 SW2 上配置 DHCP 中继,将 DHCP 哀求转发到 R1,实现自动分配 IP 地点的功能。
[*]NAT(网络地点转换):在 R1 上配置 NAT,将内部私网地点转换为公网地点,使内部网络装备能够访问公网资源。
[*]静态路由:在 R1 上配置静态缺省路由指向 ISP,确保内部网络的流量能够正确转发到 ISP,实现与外部网络的通讯。
三、测试思绪:
[*]开启 PC 的 DHCP 功能,使其自动获取 IP 地点,验证 DHCP 配置是否正确。
[*]在 PC 上进行网络访问测试,如 ping 公网地点、访问公网网站等,验证 NAT 和静态路由配置是否正确,以及网络的连通性和稳定性。
四.具体实现:
1、配置聚合链路
# SW1上:
int Eth-Trunk 1
trunkport g0/0/1
trunkport g0/0/2
# SW2上:
int Eth-Trunk 1
trunkport g0/0/1
trunkport g0/0/2
https://i-blog.csdnimg.cn/direct/5d0c989f65394b17af756abaea0a55b5.png
https://i-blog.csdnimg.cn/direct/04f5cffbe7f647da988007d79a69e3f8.png
2、VLAN:
# SW3上:
vlan batch 2 3
port link-type access
port default vlan 2
port link-type access
port default vlan 3
port link-type trunk
port trunk allow-pass vlan 2 3
port link-type trunk
port trunk allow-pass vlan 2 3
# SW4上:
vlan batch 2 3
port link-type access
port default vlan 2
port link-type access
port default vlan 3
port link-type trunk
port trunk allow-pass vlan 2 3
port link-type trunk
port trunk allow-pass vlan 2 3
# SW1上:
vlan batch 2 3
port link-type trunk
port trunk allow-pass vlan 2 3
port link-type trunk
port trunk allow-pass vlan 2 3
port link-type trunk
port trunk allow-pass vlan 2 3
# SW2上:
vlan batch 2 3
port link-type trunk
port trunk allow-pass vlan 2 3
port link-type trunk
port trunk allow-pass vlan 2 3
port link-type trunk
port trunk allow-pass vlan 2 3
https://i-blog.csdnimg.cn/direct/58526ff02ce24cf5a8be8df3cd0812aa.png
https://i-blog.csdnimg.cn/direct/4391dcc7dd764374805d53a1dc88f20f.png
https://i-blog.csdnimg.cn/direct/9ca1b37cfcf148d9a4b728b3fae1a962.png
https://i-blog.csdnimg.cn/direct/6b1780f4bc9c4d7abebb5e50823b4df1.png
3、MSTP:
# SW3上:
stp enable //华为默认开启此选项(可以忽略)
stp mode mstp //华为默认开启此选项(可以忽略)
stp region-configuration
region-name aa
revision-level 1
instance 2 vlan 2
instance 3 vlan 3
active region-configuration
stp edged-port enable //配置边缘接口(加速收敛)
stp bpdu-filter enable //过滤BPDU
stp edged-port enable
stp bpdu-filter enable
stp bpdu-protection //掩护功能
# SW4上:
stp region-configuration
region-name aa
revision-level 1
instance 2 vlan 2
instance 3 vlan 3
active region-configuration
stp edged-port enable
stp bpdu-filter enable
stp edged-port enable
stp bpdu-filter enable
stp bpdu-protection
# SW1上:
stp region-configuration
region-name aa
revision-level 1
instance 2 vlan 2
instance 3 vlan 3
active region-configuration
stp instance 2 root primary
stp instance 3 root secondary
# SW2上:
stp region-configuration
region-name aa
revision-level 1
instance 2 vlan 2
instance 3 vlan 3
active region-configuration
stp instance 3 root primary
stp instance 2 root secondary
https://i-blog.csdnimg.cn/direct/8ae0a85a68eb40b9b1c05b8e24e59f55.png
https://i-blog.csdnimg.cn/direct/06aed7134b864c3498a1b38ed82bba61.pnghttps://i-blog.csdnimg.cn/direct/4d92c6ffd39446e5b83cf29c99e30aac.png
https://i-blog.csdnimg.cn/direct/7abfd0594de04606ad0b5fcb340cc114.png
https://i-blog.csdnimg.cn/direct/408d5486d35844a18ae48d1922757507.png
https://i-blog.csdnimg.cn/direct/ff2a7f77dc854ac096ed9a648facf294.png
https://i-blog.csdnimg.cn/direct/b21dd9031e8f4f5cb50b2e78b71548dd.png
https://i-blog.csdnimg.cn/direct/f87aabe33ef84579b02e28b4a1f27b73.png
4、假造接口配置:
配置假造网关vlanif:
# SW1上:
int Vlanif 2
ip add 172.16.2.1 24
int vlanif 3
ip add 172.16.3.1 24
# SW2上:
int Vlanif 2
ip add 172.16.2.2 24
int vlanif 3
ip add 172.16.3.2 24
配置上行链路vlanif:
# SW1上:
vlan 4
int vlanif 4
ip add 172.16.4.1 24
int g0/0/5
port link-type access
port default vlan 4
ip route-static 0.0.0.0 0 172.16.4.2 //配置缺省指向R1
# SW2上:
vlan 5
int vlanif 5
ip add 172.16.5.1 24
int g0/0/5
port link-type access
port default vlan 5
ip route-static 0.0.0.0 0 172.16.5.2
https://i-blog.csdnimg.cn/direct/88a177f97d0f43e7bda98b52b0adb62e.png
https://i-blog.csdnimg.cn/direct/5f3c6d862030445f9856f8ea62975c20.png
5、配置VRRP:
# SW1上:
vrrp vrid 2 virtual-ip 172.16.2.3
vrrp vrid 2 priority 110
vrrp vrid 2 track interface Vlanif 4 reduced 20
vrrp vrid 2 preempt-mode timer delay 20
vrrp vrid 3 virtual-ip 172.16.3.3
# SW2上:
vrrp vrid 2 virtual-ip 172.16.2.3
vrrp vrid 3 virtual-ip 172.16.3.3
vrrp vrid 3 priority 110
vrrp vrid 3 track interface Vlanif 5 reduced 20
vrrp vrid 3 preempt-mode timer delay 20
https://i-blog.csdnimg.cn/direct/0f18e50361c34c25aebd86bcc07fb71a.png
https://i-blog.csdnimg.cn/direct/414724ff74c5468ea28813e72fd4b3f7.png
6、配置DHCP:
# R1先配置IP地点:
ip add 172.16.4.2 24
ip add 172.16.5.2 24
# R1上:
dhcp enable
ip pool aa
network 172.16.2.0 mask 24
gateway-list 172.16.2.3
dns-list 114.114.114.114 8.8.8.8
ip pool bb
network 172.16.3.0 mask 24
gateway-list 172.16.3.3
dns-list 114.114.114.114 8.8.8.8
int g0/0/1
dhcp select global
int g0/0/2
dhcp select global
ip route-static 172.16.2.0 24 172.16.4.1
ip route-static 172.16.3.0 24 172.16.4.1
ip route-static 172.16.2.0 24 172.16.5.1
ip route-static 172.16.3.0 24 172.16.5.1
# SW1上开启DHCP中继:
dhcp enable
int Vlanif 2
dhcp select relay
dhcp relay server-ip 172.16.4.2
int Vlanif 3
dhcp select relay
dhcp relay server-ip 172.16.4.2
# SW2上开启DHCP中继:
dhcp enable
int Vlanif 2
dhcp select relay
dhcp relay server-ip 172.16.5.2
int Vlanif 3
dhcp select relay
dhcp relay server-ip 172.16.5.2
测试:
https://i-blog.csdnimg.cn/direct/9c7ffc298fd04db18644f729949cbc25.png
https://i-blog.csdnimg.cn/direct/4075387ba04d408da19c1770aaf5bc6c.png
https://i-blog.csdnimg.cn/direct/73ee979dc7e140e0a880fb22f0f53ae3.png
https://i-blog.csdnimg.cn/direct/ec82337a70c5472da3624822d121c410.png
7、配置公网IP:
# R1上:
int g0/0/0
ip add 100.0.0.1 24
ip route-static 0.0.0.0 0 100.0.0.2
# ISP上:
int g0/0/0
ip add 100.0.0.2 24
int l0
ip add 1.1.1.1 24
8、配置NAT:
# 这里选择EASY IP
acl 2000
rule permit source 172.16.2.0 0.0.0.255
rule permit source 172.16.3.0 0.0.0.255
rule permit source 172.16.4.0 0.0.0.255
rule permit source 172.16.5.0 0.0.0.255
int g0/0/0
nat outbound 2000
9、跨VLAN与外部通讯测试:
VLAN 2主机访问 VLAN 3:
https://i-blog.csdnimg.cn/direct/a53bb41231d34ddc8e56df57ebb1947b.png
主机访问Isp:
https://i-blog.csdnimg.cn/direct/c5ed23f57e8d4829b8fd3f7fce3b841d.png
https://i-blog.csdnimg.cn/direct/aa6ceeb219114b929707ec2ca6b3d1f2.pnghttps://i-blog.csdnimg.cn/direct/d1be53da97fa488585535d2f59a51733.png
https://i-blog.csdnimg.cn/direct/32531e8a97664af8ac1c10df4a29f652.png
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]