综合实验(一)
实验要求:
(一)、VLAN规划. (15分)
1. 采用VTP方式,在接入层和汇聚层划分VLAN1,2,3,4,10 。SW3560为server, 其它SW为client.
2. 配置trunk,并进行VLAN的修剪,以便只允许必要的VLAN通过。
(二)、实现VLAN间的通信。(10分)
配置VLAN间路由,实现VLAN1,2,3,4,10之间的通信。
Vlan 1: 172.16.1.251
Vlan 2: 172.16.2.251
Vlan 3: 172.16.3.251
Vlan 4:172.16.4.251
Valn 10:172.16.10.251
(三)、按要求为二层交换机设置管理IP,并设置合适的网关。(5分)SW29-1: 172.16.1.201
SW29-2: 172.16.1.202
SW29-3: 172.16.1.203
(四)、为访问互连网提供路由。(5分)
1. 将SW3560接口F0/23、F0/24设为路由接口,并配置IP地址。
f0/23:172.16.11.1 255.255.255.0
f0/24:172.16.12.1 255.255.255.0
2. 为访问互连网设置默认路由
(五)、配置PPP协议(10 )
在R3和R4之间的广域网链路上配置PPP协议,并进行CHAP身份验证,R3做为主验证方,密钥为abc.
(六)、配置OSPF协议(15分)
1、在SW3560、R1、R3、R4上配置OSPF协议,要求采用合适的通配符掩码,只能使适当的接口参于OSPF协议。
2、要求R1、R
3、R4可以学习到SW3560上VLAN1,2,3,4,10的路由,但SW3560不能向VLAN1,2,3,4,10发送Hello包。
(七)、NAT地址转换(20分)
1、配置路由器R1,实现网站172.16.10.1静态转换为IP123.1.1.2/29, 对外提供WWW 服务。
2、内网用户共享接口IP123.1.1.1/29上网,vlan1不能访问internet。
(八)、访问控制(20分)
1、VLAN1 网管工作站可以管理(telnet)除R2以外所有的网络设备,但不能访问internet。同时,所有的网设备只能被172.16.1.0管理。telnet 的用户名:admin ,密码:123,级别15。
2、VLAN4 外部工作组,只能访问VLAN10的服务器和互连网,不能访问VLAN 1,2,3 和洛阳的局域网。
参考答案:
一、VLAN规划
A .(1) 将S3560设为服务器,定义域为abc.
S3560(config)# vtp domain abc
# vtp mode server
(2) 划分4个vlan .(vlan 2,3,4,10)
S3560(config)# vlan 2
# vlan 3
# vlan 4
# vlan 10
(3) 开启主干
S3560(config)# int f0/1
# sw trunk encap dot1q
# sw mode trunk
# sw trunk allowed vlan 1-4 S3560(config)# int f0/2
# sw trunk encap dot1q
# sw mode trunk
# sw trunk allowed vlan 1,3 S3560(config)# int f0/3
# sw trunk encap dot1q
# sw mode trunk
# sw trunk allowed vlan 1,4
(4)端口划入相应vlan
S3560(config)# int f0/20
# sw mode access
# sw acc vlan 10
B.(1)将S2950-1加入域,设为客户端
S2950(config)# vtp domain abc
# vtp mode client
(2)开启主干f0/24
S2950(config)# int f0/24
# sw mode trunk
# sw trunk allowed vlan 1-4
(3)将端口划到vlan
S2950(config)# int f0/2
# sw mode acc
# sw acc vlan 2
S2950(config)# int f0/3
# sw mode acc
# sw acc vlan 3
S2950(config)# int f0/4
# sw mode acc
# sw acc vlan 4
C.SW-2和SW3配置(略)
D.查看:
# sh vtp status
# sh vlan
#sh interface f0/1 switchport
二、实现VLAN间的通信。
(1)打开路由功能
S3560(config )# ip routing
(2)设置SVI接口,建立路由表
S3560(config )#int vlan 1
#ip add 172.16.1.251 255.255.255.0
#no shut
S3560(config )#int vlan 2
#ip add 172.16.2.251 255.255.255.0
同样,分别为VLNA3,4,10设置相应的IP地址。(略)查看:
SW# sh ip interface brief
SW# sh ip route
三、为二层交换机设置管理IP和网关
SW29-1:
int vlan 1
ip add 172.16.1.201 255.255.255.0
ip default-gateway 172.16.1.251
SW29-2:
int vlan 1
ip add 172.16.1.202 255.255.255.0
ip default-gateway 172.16.1.251
SW29-3:
int vlan 1
ip add 172.16.1.203 255.255.255.0
ip default-gateway 172.16.1.251
SW29-4:
int vlan 1
ip add 172.16.1.204 255.255.255.0
ip default-gateway 172.16.1.251
SW29-5:
int vlan 1
ip add 172.16.1.205 255.255.255.0
ip default-gateway 172.16.1.251
四、为访问互连网提供路由
1. 将接口F0/23、F0/24设为路由接口,并配置IP地址。
S3560(config )#int f0/23
#no swithcport
#ip add 172.16.11.1 255.255.255.0
S3560(config )#int f0/24
#no swithcport
#ip add 172.16.12.1 255.255.255.0
2. 为访问互连网设置默认路由
S3560(config )#ip route 0.0.0.0 0.0.0.0 172.16.11.2 查看:
sw# sh ip interface brief
sw# sh ip route
五、配置PPP
R3(config )# int S1/0
# ip add 192.168.1.1 255.255.255.0
# clock rate 2000000
# encapsulation ppp 封装PPP协议, 默认为CISCO专用的HDLC
# ppp authen chap采用CHAP验证(主验证方)
# no shut
R3 (config )# username R4 password abc
R4(config )# int S1/0
# ip add 192.168.1.2 255.255.255.0
# encapsulation ppp
# no shut
R4 (config )# username R3 password abc
查看:
R3# sh interface s1/0
R# sh ip interface brief
六、配置OSPF协议
S3560(config )#router ospf 1
#router-id 35.1.1.1
# network 172.16.0.0 0.0.255.255 area 0
# passive-interface vlan 1
# passive-interface vlan 2
# passive-interface vlan 3
# passive-interface vlan 4
# passive-interface vlan 10
R1(config )#router ospf 1
#router-id 1.1.1.1
# network 172.16.11.2 0.0.0.0 area 0
r1(config)# ip route 0.0.0.0 0.0.0.0 100.1.1.6
R3(config )#router ospf 1
#router-id 3.3.3.3
# network 172.16.12.2 0.0.0.0 area 0
# network 192.168.1.1 0.0.0.0 area 0
R4(config )#router ospf 1
#router-id 4.4.4.4
# network 172.16.128.1 0.0.0.0 area 0
# network 192.168.1.2 0.0.0.0 area 0
查看:
R# sh ip ospf neighbors
R# sh ip route
七、NAT地址转换
配置路由器R1,实现网站172.16.10.1静态转换为IP123.1.1.2/29, 内网用户共享接口IP123.1.1.1/29上网,vlan1不能上网。
1.配置接口E0和S0
r1(config) # int f0/0
# ip add 172.16.11.2 255.255.255.0
# ip nat inside
# no shut
r1(config)# int f0/1
# ip add 123.1.1.1 255.255.255.248
# ip nat outside
# no shut
2.设置静态转换
r1(config)# ip nat inside source static 172.16.10.1 123.1.1.2
3.设置动态转换
r1(config)# access-list 10 permit 172.16.2.0 0.0.0.255
# access-list 10 permit 172.16.3.0 0.0.0.255
# access-list 10 permit 172.16.4.0 0.0.0.255
r1(config )# ip nat pool abc 123.1.1.1 123.1.1.1 netmask 255.255.255.248
r1(config )# ip nat inside source list 10 pool abc overload
查看:
R# sh ip nat trans
R# debug ip nat
(八)、访问控制
1、VLAN1 网管工作站可以管理(telnet)除ISP以外所有的网络设备,但不能访问internet。同时,所有的网设备只能被172.16.1.0管理。telnet 的用户名:admin ,密码:123,级别15。
所有设备(除R2):
r(config)# username admin privilege 15 password 123
R(config)#access-list 20 permit 172.16.1.0 0.0.0.255
Router(config)#line vty 0 4
login local
access-class 10 in
2、VLAN4 外部工作组,只能访问VLAN10的服务器和互连网,不能访问VLAN 1,
2,3 和洛阳的局域网。
S3560(config)#access-list 100 deny ip any 172.16.1.0 0.0.0.255
access-list 100 deny ip any 172.16.2.0 0.0.0.255
access-list 100 deny ip any 172.16.3.0 0.0.0.255
access-list 100 deny ip any 172.16.128.0 0.0.0.255
access-list 100 permit ip any any
S3560(config)# int vlan 4
ip access-group 100 in