实战企业网络搭建:拓扑设计与设备配置完全攻略
创作时间:
2025-01-22 03:59:38
作者:
@小白创作中心
实战企业网络搭建:拓扑设计与设备配置完全攻略
企业网络的搭建是一个复杂但至关重要的过程,涉及到交换、路由和访问控制等多个方面的配置。本文将通过一个具体的实验案例,详细讲解企业网络从零到一的搭建过程,包括拓扑设计、设备配置和功能实现等关键步骤。无论是网络工程领域的从业者还是学习者,都能从中学到实用的网络配置知识。
实验拓扑
拓扑需求
交换部分:
- 将SW1-SW2间的e0/0/5、e0/0/6配置为手工方式的eth-trunk,链路编号为eth-trunk 12
- 将SW1、SW2、SW3、SW4间的所有链路配置为trunk
- 在SW1、SW2、SW3、SW4上创建vlan10、vlan20、vlan11、vlan12
- 在SW1、SW2、SW3、SW4上开启STP协议
- 将SW1设置为所有VLAN的根交换机,将SW2设置为所有VLAN的备份根交换机
- 将PC3、PC4划入vlan10、将PC7、PC8划入vlan20
路由部分:
- IP地址规划如下:
- vlan10 ----------- 10.1.10.0/24
- vlan20 ----------- 10.1.20.0/24
- vlan11 ----------- 10.1.11.0/24
- vlan12 ----------- 10.1.12.0/24
- R1-R2 ------------ 12.1.1.0/24
- R2-Client2 ------------ 20.1.1.0/24
- 将SW1设置为vlan10、vlan20的网关,IP地址为vlan对应网段的最后一个可用IP
- 将SW2设置为vlan10、vlan20的备份网关,IP地址为vlan对应网段的倒数第二个可用IP
- 将SW1的e0/0/1接口划入vlan11,并为vlan11配置对应网段的第一个可用IP
- 将SW2的e0/0/1接口划入vlan12,并为vlan12配置对应网段的第一个可用IP
- 将R1的g0/0/0接口IP配置为10.1.11.0/24网段的最后一个可用IP
- 将R1的g0/0/1接口IP配置为10.1.12.0/24网段的最后一个可用IP
- 配置R1-R2相连接口的IP地址,R1配置网段第一个可用IP,R2配置网段第二个可用IP
- 配置R2-Client2相连接口的IP地址,Client2配置网段第一个可用IP,R2配置网段最后一个可用IP
- 在SW1、SW2、R1间运行OSPF 100,将vlan10、vlan20、vlan11、vlan12对应网段宣告进area0
- 在R1上添加缺省静态路由,将下一跳指向R2
- 在R1上将缺省静态路由发布进OSPF 100
- 在R1-R2间运行OSPF 200,将R1-R2间网段以及R2-Client2间网段宣告进area0
访问控制部分:
- 在R1上配置PAT,让vlan10、vlan20内的所有主机共用12.1.1.10/24这个IP访问Client2
- 要求vlan10内的主机可以访问Client2的web服务,但不能访问Client2的ftp服务;vlan20内的主机可以访问Client2的ftp服务,但不能访问Client2的web服务;其余流量不做限制
操作步骤
SW1配置
vlan batch 10 to 12 20
stp mode stp
stp instance 0 priority 0
interface Vlanif10
ip address 10.1.10.254 255.255.255.0
#
interface Vlanif11
ip address 10.1.11.1 255.255.255.0
#
interface Vlanif20
ip address 10.1.20.254 255.255.255.0
interface Eth-Trunk12
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/1
port link-type access
port default vlan 11
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/5
eth-trunk 12
#
interface Ethernet0/0/6
eth-trunk 12
ospf 100 router-id 1.1.1.1
area 0.0.0.0
network 10.1.10.0 0.0.0.255
network 10.1.20.0 0.0.0.255
network 10.1.11.0 0.0.0.255
#
SW2配置
vlan batch 10 to 12 20stp mode stp
stp instance 0 priority 4096
interface Vlanif10
ip address 10.1.10.253 255.255.255.0
#
interface Vlanif12
ip address 10.1.12.1 255.255.255.0
#
interface Vlanif20
ip address 10.1.20.253 255.255.255.0
interface Eth-Trunk12
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/1
port link-type access
port default vlan 12
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/5
eth-trunk 12
#
interface Ethernet0/0/6
eth-trunk 12
ospf 100 router-id 2.2.2.2
area 0.0.0.0
network 10.1.10.0 0.0.0.255
network 10.1.20.0 0.0.0.255
network 10.1.12.0 0.0.0.255
SW3配置
vlan batch 10 to 12 20
stp mode stp
interface Ethernet0/0/1
port link-type access
port default vlan 10
interface Ethernet0/0/2
port link-type access
port default vlan 20
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface Ethernet0/0/4
port link-type trunk port
trunk allow-pass vlan 2 to 4094
SW4配置
vlan batch 10 to 12 20
stp mode stp
interface Ethernet0/0/1
port link-type access
port default vlan 10
interface Ethernet0/0/2
port link-type access
port default vlan 20
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface Ethernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
AR1配置
acl number 2000
rule 5 permit source 10.1.10.0 0.0.0.255
rule 10 permit source 10.1.20.0 0.0.0.255
#
acl number 3000
rule 5 permit tcp source 10.1.10.0 0.0.0.255 destination 20.1.1.1 0 destination
-port eq www
rule 10 deny tcp source 10.1.10.0 0.0.0.255 destination 20.1.1.1 0 destination-
port eq ftp
rule 15 permit tcp source 10.1.20.0 0.0.0.255 destination 20.1.1.1 0 destinatio
n-port eq ftp
rule 20 deny tcp source 10.1.20.0 0.0.0.255 destination 20.1.1.1 0 destination-
port eq www
nat address-group 0 12.1.1.10 12.1.1.10
#
interface GigabitEthernet0/0/0
ip address 10.1.11.254 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.1.12.254 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 12.1.1.1 255.255.255.0
traffic-filter outbound acl 3000
nat outbound 2000 address-group 0
ospf 100 router-id 3.3.3.3
default-route-advertise
area 0.0.0.0
network 10.1.11.0 0.0.0.255
network 10.1.12.0 0.0.0.255
#
ospf 200 router-id 3.3.3.3
area 0.0.0.0
network 12.1.1.0 0.0.0.255
#
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
AR2配置
interface GigabitEthernet0/0/0
ip address 20.1.1.254 255.255.255.0
interface GigabitEthernet0/0/2
ip address 12.1.1.2 255.255.255.0
ospf 200 router-id 5.5.5.5
area 0.0.0.0
network 12.1.1.0 0.0.0.255
network 20.1.1.0 0.0.0.255
热门推荐
舌尖上的天津:十大必打卡美食
心率低是怎么回事
恋爱消费模式:四种聪明的“公平分摊”方式
各有站队!第一波看完哪吒2的小老外,已经在外网吵翻天了
人工智能与数字化展厅设计:AI数字人+展厅展馆设计方案
道教中的无为而治哲学
贵州乌江寨旅游:多民族非遗文化与传统手工艺的完美结合
韩国签证最新政策:电子签证扩大、申请流程简化,这些变化值得关注
牛排应该怎么煎
政策调整与市场回暖双重驱动 杭州楼市2024年显韧性
如何写出高效的短视频拍摄脚本?详尽指南与实用案例
新能源汽车制动能量回收系统及控制策略方案解析
深圳市率先探索深港联合招收培养博士后
如何获取HTML中的SVG图片
生化污水消泡剂在生化污水处理中的应用及效果
这4所211高校排名不高,就业率却碾压985,性价比直接“拉满”!
短视频,正在吃孩子的大脑?
华清池简介,一池温泉,千年故事,等你来赏!
宝来高配和迈腾低配哪款好
职场排挤?如何用宽容与智慧逆袭,赢得他人尊重!
如何辨别金融诈骗电话
网站设计如何利用图形穿插排版增强页面层次感
科普之旅 | 大数据时代下的爬虫、反爬虫与反反爬虫
《心经》解读:从观自在到行深般若
怎样在银行办理银行卡的换卡业务?
三种方法帮助你在 Windows 中找回“此电脑”图标
金丝楠木的“帝王”之尊
跳绳与健康:心肺提升、骨骼增强、协调性发展、免疫代谢改善、心理减压的五大显著好处
基于Arduino UNO设计一个温控制系统
拉曼光谱能告诉您什么