实验拓扑
实验要求
全局要求:
-
网络规划,可用网段:192.168.1.0/24
-
通过rip协议实现全网通
-
所有的网络设备必须命名 vlan命名
-
网关设备可以不可以telnet只可以ssh远程访问
-
三层交换机可以telnet 也可以ssh
-
实现hsrp +STP的负载均衡和双机热备
天津部要求:
-
tj-r做DHCP分配内网IP
-
单笔路由实现跨vlan通信
-
二层交换机只可以被admin telnet其他的不可以远程
-
路由器只可以ssh远程管理不可以telnet
-
拒绝vlan200访问ISP的web和DNS,允许访问FTP
-
允许vlan300的主机访问ftp web和DNS(
www.bihuo.com
) -
允许other-A访问pingweb服务器和DNS服务器不让访问其他服务
-
没有涉及到的服务都可以访问
北京部要求:
-
HSRP+STP实现双机热备负载均衡
-
有DHCP服务器为其他的所有主机分配IP地址
-
允许adminvlan访问服务器的所有协议,
-
允许vlan otherA访问FTP服务,拒绝访问web服务
-
拒绝other-B访问FTP 服务,
-
只有admin可以ping 其他主机都不可以ping服务器
-
允许vlan10 vlan20 通过
www.bihuo.com
访问Web服务器
实验步骤
0x01 子网划分
-
查拓扑各网络,判断需要14个子网,将
192.168.1.0
划分出4位进行子网划分,划分结果如下图所示。 -
接着将划分好的网段标注在各个网段中,以便清楚的显示个网段被划分的子网情况,操作结果如下图所示。
0x02 基础网络配置
-
对DMZ-server区服务器的IP配置,操作结果如下图所示。
-
对DMZ-server区服务器配置Web服务,操作结果如下图所示。
-
对DMZ-server区服务器配置DHCP服务,操作结果如下图所示。
-
对DMZ-server区服务器配置FTP服务,操作结果如下图所示。
-
对ISP-Web服务器配置IP,操作结果如下图所示。
-
对ISP-Web服务器配置Web服务,操作结果如下图所示。
-
对ISP-DNS服务器配置IP,操作结果如下图所示。
-
对ISP-DNS服务器配置DNS服务,操作结果如下图所示。
-
对 ISP-FTP服务器配置IP,操作结果如下图所示。
-
对ISP-FTP服务器配置FTP服务,操作结果如下图所示。
-
tj-sw-zuo基础配置,操作结果如下图所示。
-
tj-sw-you基础配置,操作结果如下图所示。
-
tj-R基础配置,操作结果如下图所示。
-
ISP-B基础配置,操作结果如下图所示。
-
ISP-B-DHCP-server基础配置,操作结果如下图所示。
-
ISP-A基础配置,操作结果如下图所示。
-
bj-R基础配置,操作结果如下图所示。
-
3sw-zuo基础配置,操作结果如下图所示。
-
3sw-you基础配置,操作结果如下图所示。
-
2sw-zuo基础配置,操作结果如下图所示。
-
2sw-you基础配置,操作结果如下图所示。
-
阶段性结果检查,bj-admin-A访问
www.bihuo.com
,显示结果如下图所示。bj-admin-A检测与tj-server的连通性,操作结果如下图所示。
其他连通性也使用类似的方式进行检测,检测结果全网设备互通。
0x03 远程管理配置
-
配置tj-sw-zuo交换机的远程管理,操作结果如下图所示。
-
配置tj-sw-you交换机的远程管理,操作结果如下图所示。
-
配置tj-R路由器的远程管理,操作结果如下图所示。
-
配置bj-R路由器的远程管理,操作结果如下图所示。
-
配置3sw-zuo交换机的远程管理,操作结果如下图所示。
-
配置3sw-you交换机的远程管理,操作结果如下图所示。
-
远程管理配置完毕之后,先进行一下测试,首先使用bj-admin-A以ssh方式远程管理bj-R,操作结果如下图所示。
接着使用bj-admin-A以telnet方式远程管理bj-R,操作结果如下图所示。
最后使用bj-admin-A以ssh方式远程管理3sw-zuo,操作结果如下图所示。
其他远程管理也依据上例进行测试,测试结果符合实验要求。
0x04 ACL配置
-
在tj-sw-zuo交换机上进行ACL配置,操作结果如下图所示。
-
在tj-sw-you交换机上进行ACL配置,操作结果如下图所示。
-
在tj-R路由器上进行ACL配置,操作结果如下图所示。
-
在bj-R路由器上进行ACL配置,操作结果如下图所示。
实验结果
实验完成对按照实验要求进行验证。
-
假设3sw-zuo的
f0/4
接口意外故障,则使用bj-admin-A
访问www.bihuo.com
理论上是依然可以的,操作结果如下图所示。 -
bj-other-A访问FTP(192.168.1.146)理论上应该是可以,操作结果如下图所示。
-
bj-other-A访问Web(192.168.1.142)理论上不可访问,操作结果如下图所示。
-
bj-other-B访问FTP(192.168.1.146)理论上拒绝访问,操作结果如下图所示。
-
bj-admin-A使用ping测试与Web服务器连通性,操作结果如下图所示。
-
bj-other-A使用ping测试与Web服务器连通性,操作结果如下图所示。
-
bj-other-B访问Web(
www.bihuo.com
),操作结果如下图所示。 -
tj-admin-A使用telnet连接tj-sw-zuo,操作结果如下图所示。
-
VLAN200内主机访问ISP的Web和DNS,操作结果如下图所示。
-
vlan300主机访问
www.bihuo.com
,操作结果如下图所示。 -
tj-other-A使用ping测试与Web的连通性。
实验总结
- 配置比较复杂的实验时,首先应该配置基础的网络环境,先保证整个网络的连通性,接着再将各部分要求依次添加,最后设置各部分的ACL。
- 配置访问控制列表时要注意整合所有要求尽量使用最简的方式实现ACL,注意ACL条目的顺序和ACL应该的接口位置,都可能影响ACL的应用结果。
附录
配置脚本:
大型综合实验
1.设备命名
2.子网划分
3.基础网络配置
-> ip
-> vlan
-> route
===========================================
==============网络基础配置===================
===========================================
==============tj-sw-zuo====================
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname tj-sw-zuo
vlan 100
name tj-other
vlan 200
name tj-server
vlan 300
name tj-admin
exit
int f0/1
switchport mode trunk
int f0/2
switchport mode access
switchport access vlan 100
int f0/3
switchport mode access
switchport access vlan 200
int range f0/4-5
switchport mode trunk
channel-group 1 mode on
==============tj-sw-you====================
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname tj-sw-you
vlan 100
name tj-other
vlan 200
name tj-server
vlan 300
name tj-admin
exit
int f0/1
switchport mode access
switchport access vlan 100
int f0/2
switchport mode access
switchport access vlan 300
int range f0/3-4
switchport mode trunk
channel-group 1 mode on
==============tj-R=======================
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname tj-R
int f0/1.1
encapsulation dot1Q 100
ip add 192.168.1.49 255.255.255.240
no sh
int f0/1.2
encapsulation dot1Q 200
ip add 192.168.1.65 255.255.255.240
no sh
int f0/1.3
encapsulation dot1Q 300
ip add 192.168.1.81 255.255.255.240
no sh
int f0/1
no sh
int s1/0
ip add 192.168.1.226 255.255.255.240
no sh
exit
ip dhcp pool tj-vlan100
network 192.168.1.48 255.255.255.240
default-router 192.168.1.49
dns-server 192.168.1.141
exit
ip dhcp excluded-address 192.168.1.49 192.168.1.52
ip dhcp pool tj-vlan200
network 192.168.1.64 255.255.255.240
default-router 192.168.1.65
dns-server 192.168.1.141
exit
ip dhcp excluded-address 192.168.1.65 192.168.1.65
ip dhcp pool tj-vlan300
network 192.168.1.80 255.255.255.240
default-router 192.168.1.81
dns-server 192.168.1.141
exit
ip dhcp excluded-address 192.168.1.81 192.168.1.81
route rip
version 2
no auto-summary
network 192.168.1.48
network 192.168.1.64
network 192.168.1.80
network 192.168.1.224
==================ISP-B===============
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname ISP-B
int f0/0
ip add 192.168.1.242 255.255.255.240
no sh
int f0/1
ip add 192.168.1.194 255.255.255.240
no sh
int s1/0
ip add 192.168.1.225 255.255.255.240
clock rate 9600
no sh
route rip
version 2
no auto-summary
network 192.168.1.224
network 192.168.1.240
network 192.168.1.192
==================ISP-B-DHCP-server======
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname ISP-B-DHCP-server
ip routing
int f0/3
no switchport
ip add 192.168.1.193 255.255.255.240
no sh
int vlan 1
ip add 192.168.1.145 255.255.255.240
no sh
exit
ip dhcp pool ISP-B-pool
network 192.168.1.144 255.255.255.240
default-router 192.168.1.145
dns-server 192.168.1.141
exit
ip dhcp excluded-address 192.168.1.145 192.168.1.146
route rip
version 2
no auto-summary
network 192.168.1.192
network 192.168.1.144
=================ISP-A==================
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname ISP-A
int f0/1
ip add 192.168.1.241 255.255.255.240
no sh
int f0/0
ip add 192.168.1.129 255.255.255.240
no sh
int s1/0
ip add 192.168.1.210 255.255.255.240
clock rate 9600
no sh
route rip
version 2
no auto-summary
network 192.168.1.240
network 192.168.1.128
network 192.168.1.208
==================bj-R==================
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname bj-R
int s1/0
ip add 192.168.1.209 255.255.255.240
no sh
int f0/0
ip add 192.168.1.162 255.255.255.240
no sh
int f0/1
ip add 192.168.1.178 255.255.255.240
no sh
exit
route rip
version 2
no auto-summary
network 192.168.1.208
network 192.168.1.160
network 192.168.1.176
===================3sw-zuo================
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname 3sw-zuo
vlan 10
name bj-admin
vlan 20
name bj-other
vlan 100
name DMZ-server
exit
ip routing
int range f0/1-3
switchport trunk encapsulation dot1Q
switchport mode trunk
int f0/4
no switchport
ip add 192.168.1.161 255.255.255.240
no sh
int vlan 10
ip add 192.168.1.2 255.255.255.240
no sh
ip helper-address 192.168.1.46
int vlan 20
ip add 192.168.1.18 255.255.255.240
no sh
ip helper-address 192.168.1.46
int vlan 100
ip add 192.168.1.34 255.255.255.240
no sh
ip helper-address 192.168.1.46
exit
route rip
version 2
no auto-summary
network 192.168.1.0
network 192.168.1.16
network 192.168.1.32
network 192.168.1.160
spanning-tree vlan 10 root primary
spanning-tree vlan 20 root secondary
spanning-tree vlan 100 root primary
int vlan 10
standby 10 ip 192.168.1.1
standby 10 priority 105
standby 10 preempt
standby 10 track f0/4
int vlan 20
standby 20 ip 192.168.1.17
standby 20 priority 100
standby 20 preempt
standby 20 track f0/4
int vlan 100
standby 100 ip 192.168.1.33
standby 100 priority 105
standby 100 preempt
standby 100 track f0/4
=================3sw-you===========
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname 3sw-you
vlan 10
name bj-admin
vlan 20
name bj-other
vlan 100
name DMZ-server
exit
ip routing
int range f0/1-3
switchport trunk encapsulation dot1Q
switchport mode trunk
int f0/4
no switchport
ip add 192.168.1.177 255.255.255.240
no sh
int vlan 10
ip add 192.168.1.3 255.255.255.240
no sh
ip helper-address 192.168.1.46
int vlan 20
ip add 192.168.1.19 255.255.255.240
no sh
ip helper-address 192.168.1.46
int vlan 100
ip add 192.168.1.35 255.255.255.240
no sh
ip helper-address 192.168.1.46
exit
route rip
version 2
no auto-summary
network 192.168.1.0
network 192.168.1.16
network 192.168.1.32
network 192.168.1.176
spanning-tree vlan 10 root secondary
spanning-tree vlan 20 root primary
spanning-tree vlan 100 root secondary
int vlan 10
standby 10 ip 192.168.1.1
standby 10 priority 100
standby 10 preempt
standby 10 track f0/4
int vlan 20
standby 20 ip 192.168.1.17
standby 20 priority 105
standby 20 preempt
standby 20 track f0/4
int vlan 100
standby 100 ip 192.168.1.33
standby 100 priority 100
standby 100 preempt
standby 100 track f0/4
===============2sw-zuo===============
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname 2sw-zuo
vlan 10
name bj-admin
vlan 20
name bj-other
vlan 100
name DMZ-server
exit
int f0/1
switchport mode access
switchport access vlan 100
int f0/2
switchport mode access
switchport access vlan 10
int f0/3
switchport mode access
switchport access vlan 20
int range f0/4-5
switchport mode trunk
==============2sw-you===============
en
conf t
no ip domain-lookup
line console 0
exec-timeout 0 0
logging syn
exit
hostname 2sw-you
vlan 10
name bj-admin
vlan 20
name bj-other
vlan 100
name DMZ-server
exit
int f0/1
switchport mode access
switchport access vlan 10
int f0/2
switchport mode access
switchport access vlan 20
int range f0/3-4
switchport mode trunk
4.远程管理配置
===========================================
==============远程管理配置===================
===========================================
=================tj-sw-zuo=================
en
conf t
enable pass cisco
int vlan 100
ip add 192.168.1.50 255.255.255.240
no sh
exit
ip default-gateway 192.168.1.49
line vty 0 4
pass cisco
login
exit
=================tj-sw-you=================
en
conf t
enable pass cisco
int vlan 100
ip add 192.168.1.51 255.255.255.240
no sh
exit
ip default-gateway 192.168.1.49
line vty 0 4
pass cisco
login
exit
==================tj-R==================
en
conf t
enable pass cisco
ip domain-name cisco.com
crypto key generate rsa general-keys modulus 1024
username admin password cisco
ip ssh version 2
ip ssh time-out 120
ip ssh authentication-retries 3
line vty 0 4
transport input ssh
login local
==================bj-R=================
en
conf t
enable pass cisco
ip domain-name cisco.com
crypto key generate rsa general-keys modulus 1024
username admin password cisco
ip ssh version 2
ip ssh time-out 120
ip ssh authentication-retries 3
line vty 0 4
transport input ssh
login local
==================3sw-zuo==============
en
conf t
enable pass cisco
ip domain-name cisco.com
crypto key generate rsa general-keys modulus 1024
username admin password cisco
ip ssh version 2
ip ssh time-out 120
ip ssh authentication-retries 3
line vty 0 4
transport input all
login local
===================3sw-you================
en
conf t
enable pass cisco
ip domain-name cisco.com
crypto key generate rsa general-keys modulus 1024
username admin password cisco
ip ssh version 2
ip ssh time-out 120
ip ssh authentication-retries 3
line vty 0 4
transport input all
login local
5.ACL配置
===========================================
=================ACL配置====================
===========================================
================tj-sw-zuo(you)======================
access-list 10 permit 192.168.1.80 0.0.0.15
line vty 0 4
access-class 10 in
================tj-R=======================
ip access-list extended tj-ACL-ISP
deny tcp 192.168.1.64 0.0.0.15 host 192.168.1.142 eq 80
deny udp 192.168.1.64 0.0.0.15 host 192.168.1.141 eq 53
permit tcp 192.168.1.64 0.0.0.15 host 192.168.1.146 eq 21
permit tcp 192.168.1.80 0.0.0.15 host 192.168.1.142 eq 80
permit tcp 192.168.1.80 0.0.0.15 host 192.168.1.141 eq 53
permit tcp 192.168.1.80 0.0.0.15 host 192.168.1.146 eq 21
permit icmp host 192.168.1.54 host 192.168.1.142 echo
permit icmp host 192.168.1.54 host 192.168.1.141 echo
deny tcp host 192.168.1.54 any
permit ip any any
exit
int s1/0
ip access-group tj-ACL-ISP out
======================bj-R===================
ip access-list extended bj-ACL-ISP
permit ip 192.168.1.0 0.0.0.15 any
permit tcp host 192.168.1.22 host 192.168.1.146 eq 21
deny tcp host 192.168.1.22 host 192.168.1.142 eq 80
deny tcp host 192.168.1.24 host 192.168.1.146 eq 21
permit icmp 192.168.1.0 0.0.0.15 host 192.168.1.142
permit icmp 192.168.1.0 0.0.0.15 host 192.168.1.141
permit icmp 192.168.1.0 0.0.0.15 host 192.168.1.146
deny icmp any host 192.168.1.142
deny icmp any host 192.168.1.141
deny icmp any host 192.168.1.146
permit udp 192.168.1.0 0.0.0.15 host 192.168.1.141 eq 53
permit udp 192.168.1.16 0.0.0.15 host 192.168.1.141 eq 53
permit ip any any
exit
int s1/0
ip access-group bj-ACL-ISP out
-
PKT文件获取方式:链接:https://pan.baidu.com/s/1tbpxMZ0qowYvPPcVQt-EaQ 提取码:zmeo
-
由于PT中做DHCP无法为主机预分配地址,在做ACL配置的要注意动态获取的IP,即使时相同拓扑打开之后自动获取的IP信息也不一样,因此建议修改ACL配置脚本后重新设置ACL.