中大型企业网架构

中大型企业网架构_第1张图片
项目名称:园区网架构设计 / 升级
项目需求:
1.不同的PC属于不同的 VLAN ,如图所示;
2.不同的 VLAN 的IP地址为: 192.168.XX.0/24 , XX 是 vlan 号;
3.不同的 VLAN 主机获得IP地址的方式为 DHCP (除特殊需求以外)
每个 VLAN 的主机的网关IP地址,均为: 192.168.XX.254/24;
4.vlan88 为 web-server 所在的服务器;网关在 SW5 上;
vlan66 为 dhcp-server所在的服务器;网关在 SW6 上;
5.其他 VLAN 的每个主机所用的网关都使用了高可用性技术,增强了网关
冗余性和稳定性。
6.交换机之间也使用了防环技术,并且能够针对每个 VLAN 实现流量负载
均衡的功能。同时,要求每个 VLAN 的主机,去往主机的网关时,所使用
的转发路径是最优的。
7.在公司内部运行 OSPF ,确保不同 VLAN 之间是互通的。
不同的 VLAN 属于不同的区域。
同时保护 web 和 dhcp 服务器所在的区域不受到外部链路以及其他区域
的不稳定的链路的影响。
8.公司的出口路由器为 R1 和 R2 ,但是永远将 R1 作为主出口,出现故障
后,出网流量才会自动的切换到 R2 。修复以后,会再次从 R1 转发。
9.内网大量主机都存在访问 Internet的需求,要求使用最节省IP地址的
方式实现内网主机上网,但是 vlan 40 属于机密部分,不能访问外网。
10.外网的用户(client-1),可以访问内部的 web 服务器。
11.外网的用户(SW9),可以远程控制内网的所有网络设备(不包括R1/R2),
远程访问密码均设置为 HCIE 。
(内网中每个设备的管理IP地址,属于管理 VLAN 199)
12.内网的用户中,只能由 vlan 20 中的 PC-2 远程登录管理内网所有设备
其他用户均不可以。
配置命令:
步骤一:创建vlan以及IP地址创建
创建Vlan并且将所有连接PC机的链路设置为access 连接交换机的链路为trunk
SW1:
Un t m
Sys
Sys SW1
vlan batch 10 20
int e0/0/1
port link-type access
port default vlan 10
int e0/0/2
port link-type access
port default vlan 20
q
port-group 1
group-member e0/0/15 e0/0/16
port link-type trunk
port trunk allow-pass vlan all
SW2:
Un t m
sys
Sys SW2
vlan batch 10 30
int e0/0/3
port link-type access
port default vlan 10
int e0/0/4
port link-type access
port default vlan 30
q
port-group group-member e0/0/5 e0/0/6
port link-type trunk
port trunk allow-pass vlan all
SW3:
Un t m
sys
Sys SW3
vlan batch 20 40
int e0/0/5
port link-type access
port default vlan 20
int e0/0/6
port link-type access
port default vlan 40
q
port-group group-member e0/0/13 Ethernet 0/0/14
port link-type trunk
port trunk allow-pass vlan all
SW4:
un t m
sys
sys SW4
vlan batch 40 30
int e0/0/7
port link-type access
port default vlan 40
int e0/0/8
port link-type access
port default vlan 30
q
port-group group-member e0/0/17 e0/0/18
port link-type trunk
port trunk allow-pass vlan all
SW5:
Un t m
Sys
Sys SW5
vlan batch 10 20 30 40 88 66 100 101 130
int Vlanif 88
ip ad 192.168.88.254 24
q
int Vlanif 100
ip ad 192.168.100.5 24
q
int Vlanif 10
ip ad 192.168.10.5 24
q
int Vlanif 20
ip ad 192.168.20.5 24
q
int Vlanif 30
ip ad 192.168.30.5 24
q
int Vlanif 40
ip ad 192.168.40.5 24
q
int g0/0/8
port link-type access
port default vlan 88
q
port-group group-member g0/0/15 g0/0/5 g0/0/13 g0/0/17 g0/0/24 g0/0/2 g0/0/1
port link-type trunk
port trunk allow-pass vlan all
SW6
Un t m
Sys
Sys SW6
vlan batch 10 20 30 40 88 66 100 101 130
int Vlanif 66
ip ad 192.168.66.254 24
q
int vlanif 101
ip ad 192.168.101.6 24
q
int Vlanif 10
ip ad 192.168.10.6 24
q
int Vlanif 20
ip ad 192.168.20.6 24
q
int Vlanif 30
ip ad 192.168.30.6 24
q
int Vlanif 40
ip ad 192.168.40.6 24
q
int g0/0/8
port link-type access
port default vlan 66
port-group group-member g0/0/4 g0/0/3 g0/0/24 g0/0/16 g0/0/6 g0/0/14 g0/0/18
port link-type trunk
port trunk allow-pass vlan all
SW7:
Un t m
Sys
Sys SW7
vlan batch 10 20 30 40 88 66 100 101 110
vlan batch 130 200
interface Vlanif 100
ip ad 192.168.100.7 24
q
interface Vlanif 130
ip ad 192.168.130.7 24
q
interface Vlanif 110
ip ad 192.168.110.7 24
q
interface Vlanif 200
ip ad 192.168.200.7 24
q
int g0/0/2
port link-type access
port default vlan 200
int g0/0/4
port link-type access
port default vlan 110
q
port-group group-member g0/0/1 g0/0/3 g0/0/24
port link-type trunk
port trunk allow-pass vlan all
SW8:
Un t m
Sys
Sys SW8
vlan batch 10 20 30 40 88 66 100 120 101
vlan batch 130 201
int Vlanif 201
ip ad 192.168.201.8 24
q
int Vlanif 130
ip ad 192.168.130.8 24
int Vlanif 101
ip ad 192.168.101.8 24
int Vlanif 120
ip ad 192.168.120.8 24
int g0/0/5
port link-type access
port default vlan 201
int g0/0/3
port link-type access
port default vlan 120
port-group group-member g0/0/24 g0/0/2 g0/0/4
port link-type trunk
port trunk allow-pass vlan all
R1:
Un t m
Sys
Sys R1
ip route-static 0.0.0.0 0 20.1.1.2
Int g0/0/0
Ip ad 192.168.200.1 24
Int g0/0/1
Ip ad 192.168.120.1 24
Int g0/0/2
Ip ad 20.1.1.1 24
R2:
Un t m
Sys
Sys R2
ip route-static 0.0.0.0 0 21.1.1.2
Int g0/0/0
Ip ad 192.168.110.2 24
Int g0/0/1
Ip ad 192.168.201.2 24
Int g0/0/2
Ip ad 21.1.1.1 24
步骤二:创建MSTP 以及选择主根副根
设置Vlan10 20 30 40 以及交换机相连的链路设置主副根 这里加入100、130、101是因为两个交换机之间的链路要是不加进来默认走实例0因此会导致建立不了邻居关系
SW7:
stp region-configuration
region-name ntd
instance 1 vlan 10 20 88 100 130
instance 2 vlan 30 40 101
active region-configuration
q
stp instance 1 priority 0
stp instance 2 priority 4096
SW8:
stp region-configuration
region-name ntd
instance 1 vlan 10 20 88 100 130
instance 2 vlan 30 40 101
active region-configuration
q
stp instance 1 priority 4096
stp instance 2 priority 0
SW5:
stp region-configuration
region-name ntd
instance 1 vlan 10 20 88 100 130
instance 2 vlan 30 40 101
active region-configuration
SW6:
stp region-configuration
region-name ntd
instance 1 vlan 10 20 88 100 130
instance 2 vlan 30 40 101
active region-configuration
SW4:
stp region-configuration
region-name ntd
instance 1 vlan 10 20 88 100 130
instance 2 vlan 30 40 101
active region-configuration
SW3:
stp region-configuration
region-name ntd
instance 1 vlan 10 20 88 100 130
instance 2 vlan 30 40 101
active region-configuration
SW2:
stp region-configuration
region-name ntd
instance 1 vlan 10 20 88 100 130
instance 2 vlan 30 40 101
active region-configuration
SW1:
stp region-configuration
region-name ntd
instance 1 vlan 10 20 88 100 130
instance 2 vlan 30 40 101
active region-configuration
步骤三:配置VRRP以及端口追踪
在交换机SW7和SW8上创建虚拟网关并且开启端口追踪要是这个端口坏掉就走副网关上
SW7:
Int Vlanif 10
ip ad 192.168.10.7 24
vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 150
vrrp vrid 10 track interface GigabitEthernet 0/0/2 reduced 100
q
Int Vlanif 20
ip ad 192.168.20.7 24
vrrp vrid 20 virtual-ip 192.168.20.254
vrrp vrid 20 priority 150
vrrp vrid 20 track interface GigabitEthernet 0/0/2 reduced 100
q
Int Vlanif 30
ip ad 192.168.30.7 24
vrrp vrid 30 virtual-ip 192.168.30.254
vrrp vrid 30 priority 100
q
Int Vlanif 40
ip ad 192.168.40.7 24
vrrp vrid 40 virtual-ip 192.168.40.254
vrrp vrid 40 priority 100
q
SW8:
Int Vlanif 10
ip ad 192.168.10.8 24
vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 100
q
Int Vlanif 20
ip ad 192.168.20.8 24
vrrp vrid 20 virtual-ip 192.168.20.254
vrrp vrid 20 priority 100
q
Int Vlanif 30
ip ad 192.168.30.8 24
vrrp vrid 30 virtual-ip 192.168.30.254
vrrp vrid 30 priority 150
vrrp vrid 30 track interface GigabitEthernet 0/0/3 reduced 100
q
Int Vlanif 40
ip ad 192.168.40.8 24
vrrp vrid 40 virtual-ip 192.168.40.254
vrrp vrid 40 priority 150
vrrp vrid 40 track interface GigabitEthernet 0/0/3 reduced 100
q
步骤四:配置OSPF 并且建立邻居关系
建立邻居关系的时候要注意0区域只宣告上面4个相连的网段,但是88区域和66区域要选一下两个交换机直连的网段,并且SW5和SW6要宣告一下和交换机直连的以及88网段和66网段,这样才能保证整个区域是互通的,而且将两个区域设置为特殊区域。
R1:
ospf router-id 10.10.10.10
default-route-advertise
area 0
network 192.168.120.0 0.0.0.255
network 192.168.200.0 0.0.0.255
q
int g0/0/1
ospf cost 20
R2:
ospf router-id 20.20.20.20
default-route-advertise cost 20
area 0
network 192.168.201.0 0.0.0.255
network 192.168.110.0 0.0.0.255
q
int g0/0/0
ospf cost 20
SW7:
ospf router-id 7.7.7.7
area 0
network 192.168.200.0 0.0.0.255
network 192.168.130.0 0.0.0.255
network 192.168.110.0 0.0.0.255
q
area 88
network 192.168.100.0 0.0.0.255
stub no-summary
q
area 10
network 192.168.10.0 0.0.0.255
q
area 20
network 192.168.20.0 0.0.0.255
q
area 30
network 192.168.30.0 0.0.0.255
q
area 40
network 192.168.40.0 0.0.0.255
q
SW8:
ospf router-id 8.8.8.8
area 0
network 192.168.130.0 0.0.0.255
network 192.168.120.0 0.0.0.255
network 192.168.201.0 0.0.0.255
q
area 66
network 192.168.101.0 0.0.0.255
stub no-summary
q
area 10
network 192.168.10.0 0.0.0.255
q
area 20
network 192.168.20.0 0.0.0.255
q
area 30
network 192.168.30.0 0.0.0.255
q
area 40
network 192.168.40.0 0.0.0.255
q
SW5:
ospf router-id 5.5.5.5
area 88
network 192.168.88.0 0.0.0.255
network 192.168.100.0 0.0.0.255
stub no-summary
q
area 10
network 192.168.10.0 0.0.0.255
q
area 20
network 192.168.20.0 0.0.0.255
q
area 30
network 192.168.30.0 0.0.0.255
q
area 40
network 192.168.40.0 0.0.0.255
SW6::
ospf router-id 6.6.6.6
area 66
network 192.168.101.0 0.0.0.255
network 192.168.66.0 0.0.0.255
stub no-summary
q
area 10
network 192.168.10.0 0.0.0.255
q
area 20
network 192.168.20.0 0.0.0.255
q
area 30
network 192.168.30.0 0.0.0.255
q
area 40
network 192.168.40.0 0.0.0.255
步骤五:配置DHCP服务器以及中继器
配置DHCP服务器的时候要注意写一条默认路由因为不在区域内。
DHCP服务器:
Un t m
Sys
Sys DHCP
dhcp enable
ip route-static 0.0.0.0 0 192.168.66.254
Int g0/0/0
ip ad 192.168.66.1 24
dhcp select global
q
ip pool 1
network 192.168.10.0 mask 24
gateway-list 192.168.10.254
dns-list 1.1.1.1
q
ip pool 20
network 192.168.20.0 mask 24
gateway-list 192.168.20.254
dns-list 2.2.2.22
q
ip pool 30
network 192.168.30.0 mask 24
gateway-list 192.168.30.254
q
ip pool 40
network 192.168.40.0 mask 24
gateway-list 192.168.40.254
做中继的时候要注意在虚拟接口上配置中继服务,不然不生效
SW6:
dhcp enable
int Vlanif 10
dhcp select relay
dhcp relay server-ip 192.168.66.1
q
int Vlanif 20
dhcp select relay
dhcp relay server-ip 192.168.66.1
q
int Vlanif 30
dhcp select relay
dhcp relay server-ip 192.168.66.1
q
int Vlanif 40
dhcp select relay
dhcp relay server-ip 192.168.66.1
步骤六:配置ACL以及NAT、NATserver。
写NATserver的是要注意公网后面的端口号一定不要一样,如果一样就会冲突 但是最后写的内网地址后面一定要写正确的协议号
R1:
ACL 2000
rule 5 deny source 192.168.40.0 0.0.0.0
rule 10 permit source any
q
int g0/0/2
nat outbound 2000
nat server protocol tcp global 20.1.1.11 80 inside 192.168.88.1 80
nat server protocol tcp global 20.1.1.11 191 inside 192.168.199.1 23
nat server protocol tcp global 20.1.1.11 192 inside 192.168.199.2 23
nat server protocol tcp global 20.1.1.11 193 inside 192.168.199.3 23
nat server protocol tcp global 20.1.1.11 194 inside 192.168.199.4 23
nat server protocol tcp global 20.1.1.11 195 inside 192.168.199.5 23
nat server protocol tcp global 20.1.1.11 196 inside 192.168.199.6 23
nat server protocol tcp global 20.1.1.11 197 inside 192.168.199.7 23
nat server protocol tcp global 20.1.1.11 198 inside 192.168.199.8 23
R2:
acl 2000
rule 5 deny source 192.168.40.0 0.0.0.255
rule 10 permit source any
q
int g0/0/2
nat outbound 2000
nat server protocol tcp global 21.1.1.11 80 inside 192.168.88.1 80
nat server protocol tcp global 21.1.1.11 191 inside 192.168.199.1 23
nat server protocol tcp global 21.1.1.11 192 inside 192.168.199.2 23
nat server protocol tcp global 21.1.1.11 193 inside 192.168.199.3 23
nat server protocol tcp global 21.1.1.11 194 inside 192.168.199.4 23
nat server protocol tcp global 21.1.1.11 195 inside 192.168.199.5 23
nat server protocol tcp global 21.1.1.11 196 inside 192.168.199.6 23
nat server protocol tcp global 21.1.1.11 197 inside 192.168.199.7 23
nat server protocol tcp global 21.1.1.11 198 inside 192.168.199.8 23

步骤七:配置设备远程以及创建IP地址
SW1:
sys
user-interface vty 0 4
user privilege level 3
authentication-mode password
set authentication password cipher HICE
q
telnet server enable
Vlan 199
Int Vlanif 199
ip ad 192.168.199.1 24
q
ospf router-id 1.1.1.1
area 199
network 192.168.199.0 0.0.0.255
SW2:
sys
user-interface vty 0 4
user privilege level 3
authentication-mode password
set authentication password cipher HICE
q
telnet server enable
Vlan 199
Int Vlanif 199
ip ad 192.168.199.2 24
q
ospf router-id 2.2.2.2
area 199
network 192.168.199.0 0.0.0.255
SW3:
sys
user-interface vty 0 4
user privilege level 3
authentication-mode password
set authentication password cipher HICE
q
telnet server enable
Vlan 199
Int Vlanif 199
ip ad 192.168.199.3 24
q
ospf router-id 1.1.1.1
area 199
network 192.168.199.0 0.0.0.255
SW4:
sys
user-interface vty 0 4
user privilege level 3
authentication-mode password
set authentication password cipher HICE
q
telnet server enable
Vlan 199
Int Vlanif 199
ip ad 192.168.199.4 24
q
ospf router-id 4.4.4.4
area 199
network 192.168.199.0 0.0.0.255
SW5:
sys
user-interface vty 0 4
user privilege level 3
authentication-mode password
set authentication password cipher HICE
q
telnet server enable
Vlan 199
Int Vlanif 199
ip ad 192.168.199.5 24
q
ospf
area 199
network 192.168.199.0 0.0.0.255
SW6:
sys
user-interface vty 0 4
user privilege level 3
authentication-mode password
set authentication password cipher HICE
q
telnet server enable
Vlan 199
Int Vlanif 199
ip ad 192.168.199.6 24
q
ospf
area 199
network 192.168.199.0 0.0.0.255
SW7:
sys
user-interface vty 0 4
user privilege level 3
authentication-mode password
set authentication password cipher HICE
q
telnet server enable
Vlan 199
Int Vlanif 199
ip ad 192.168.199.7 24
q
ospf
area 199
network 192.168.199.0 0.0.0.255
SW8:
sys
user-interface vty 0 4
user privilege level 3
authentication-mode password
set authentication password cipher HICE
q
telnet server enable
Vlan 199
Int Vlanif 199
ip ad 192.168.199.8 24
q
ospf
area 199
network 192.168.199.0 0.0.0.255
步骤八:只允许Vlan20中的PC2远程内网的所有设备
SW1:
Acl 2000
rule 5 permit source 192.168.20.253 0.0.0.0
rule 10 permit source 20.1.1.1 0.0.0.0
rule 15 permit source 21.1.1.1 0.0.0.0
q
user-interface vty 0 4
ACL 2000 inbound
SW2:
Acl 2000
rule 5 permit source 192.168.20.253 0.0.0.0
rule 10 permit source 20.1.1.1 0.0.0.0
rule 15 permit source 21.1.1.1 0.0.0.0
q
user-interface vty 0 4
ACL 2000 inbound
SW3:
Acl 2000
rule 5 permit source 192.168.20.253 0.0.0.0
rule 10 permit source 20.1.1.1 0.0.0.0
rule 15 permit source 21.1.1.1 0.0.0.0
q
user-interface vty 0 4
ACL 2000 inbound
SW4:
Acl 2000
rule 5 permit source 192.168.20.253 0.0.0.0
rule 10 permit source 20.1.1.1 0.0.0.0
rule 15 permit source 21.1.1.1 0.0.0.0
q
user-interface vty 0 4
ACL 2000 inbound
SW5:
Acl 2000
rule 5 permit source 192.168.20.253 0.0.0.0
rule 10 permit source 20.1.1.1 0.0.0.0
rule 15 permit source 21.1.1.1 0.0.0.0
q
user-interface vty 0 4
ACL 2000 inbound
SW6:
Acl 2000
rule 5 permit source 192.168.20.253 0.0.0.0
rule 10 permit source 20.1.1.1 0.0.0.0
rule 15 permit source 21.1.1.1 0.0.0.0
q
user-interface vty 0 4
ACL 2000 inbound
SW7:
Acl 2000
rule 5 permit source 192.168.20.253 0.0.0.0
rule 10 permit source 20.1.1.1 0.0.0.0
rule 15 permit source 21.1.1.1 0.0.0.0
SW8:
Acl 2000
rule 5 permit source 192.168.20.253 0.0.0.0
rule 10 permit source 20.1.1.1 0.0.0.0
rule 15 permit source 21.1.1.1 0.0.0.0
q
user-interface vty 0 4
ACL 2000 inbound
R1:
Acl 2000
rule 5 permit source 192.168.20.253 0.0.0.0
rule 10 permit source 20.1.1.1 0.0.0.0
rule 15 permit source 21.1.1.1 0.0.0.0
q
user-interface vty 0 4
ACL 2000 inbound
R2:
Acl 2000
rule 5 permit source 192.168.20.253 0.0.0.0
rule 10 permit source 20.1.1.1 0.0.0.0
rule 15 permit source 21.1.1.1 0.0.0.0
q
user-interface vty 0 4
ACL 2000 inbound

实验中出现的问题:

  1. MSTP如果不将SW5和SW7;SW6和SW8相连的路线加入到实例1;实例2里面去,默认走的是实例0,因此有可能会建立不了邻居关系,是因为端口可能是阻塞的。所以必须加入到实例里面去。
  2. 在做完NATserver以后WEB服务正常能访问,但是远程访问不了。是因为NAT的特点就是出向和入向必须是一个接口,链路走的也必须一致。所以将R1连接交换机的链路的cost值修改以后就能正常访问了,cost的默认值是1,(越小越优先)所以将连接SW8的链路的COST值改高一点就可以了。R2上也是同理。
    总结:
  3. 整体实验的命令以及配置,只要写对了,就没问题。正常也能走需要的链路。
  4. 配置的时候要注意NATserver流量的走向问题。如果进出不一致就会导致外网访问不了内网的东西。

你可能感兴趣的:(综合实验拓扑)