作者:承志68694849 | 来源:互联网 | 2023-09-17 16:25
题干要求和实验拓扑图:实验步骤:1.根据拓扑图配置vlan由于配置繁琐,我们就对sw1与sw2的配置进行展示:sw1:[sw1]vlanbatch2to5[sw1]vlan2[sw
题干要求和实验拓扑图:
实验步骤:
1.根据拓扑图配置vlan
由于配置繁琐,我们就对sw1与sw2的配置进行展示:
sw1:
[sw1]vlan batch 2 to 5
[sw1]vlan 2
[sw1]int vlan 2
[sw1-Vlanif2]ip add 10.1.2.254 24
[sw1]vlan 3
[sw1]int vlan 3
[sw1-Vlanif3]ip add 10.1.3.254 24
[sw1]vlan 114
[sw1]int vlan 114
[sw1-Vlanif114]ip add 10.1.114.1 24
[sw1]vlan 100
[sw1]int vlan 100
[sw1-Vlanif100]ip add 10.1.100.254 24
[sw1-Vlanif11]ip add 10.1.11.2 24
g0/0/2接口:
[sw1-GigabitEthernet0/0/2]port link-type trunk
[sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan 2 3
g0/0/3接口:
[sw1-GigabitEthernet0/0/3]port link-type trunk
[sw1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2
g0/0/1接口:
[sw1]int g0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 114
g0/0/4接口:
[sw1]int g0/0/4
[sw1-GigabitEthernet0/0/4]port link-type trunk
[sw1-GigabitEthernet0/0/4]port trunk allow-pass vlan 100
g0/0/5接口:
[sw1]int g0/0/5
[sw1-GigabitEthernet0/0/5]port link-type access
[sw1-GigabitEthernet0/0/5]port default vlan 11
创建池子,建立dhcp:
[sw1]ip pool vlan2
[sw1-ip-pool-vlan2]network 10.1.2.0 mask 24
[sw1-ip-pool-vlan2]gateway-list 10.1.2.254
[sw1-Vlanif2]dhcp select global
sw2:
g0/0/1:
[sw2-GigabitEthernet0/0/3]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
g0/0/2:
[sw2]int g0/0/2
[sw2-GigabitEthernet0/0/2]port link-type access
[sw2-GigabitEthernet0/0/2]port default vlan 2
g0/0/3:
[sw2-GigabitEthernet0/0/2]int g0/0/3
[sw2-GigabitEthernet0/0/3]port link-type access
[sw2-GigabitEthernet0/0/3]port default vlan 3
其余同理即可
r1配置:
[r1]ip route-static 0.0.0.0 0 100.1.1.2
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 10.1.0.0 0.0.0.255
[r1-acl-basic-2000]int g0/0/2
[r1-GigabitEthernet0/0/2]nat outbound 2000
2.OSPF配置:
r1:
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]net 10.1.11.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]net 10.1.14.0 0.0.0.255
[r1-ospf-1]default-route-advertise
[sw1-ospf-1-area-0.0.0.0]dis this
area 0.0.0.0
network 10.1.11.0 0.0.0.255
network 10.1.114.0 0.0.0.255
return
[sw4-ospf-1-area-0.0.0.0]dis this
area 0.0.0.0
network 10.1.114.0 0.0.0.255
network 10.1.14.0 0.0.0.255
sw1:
[sw1]ospf 1 router-id 11.11.11.11
[sw1-ospf-1]area 1
[sw1-ospf-1-area-0.0.0.1]network 10.1.2.0 0.0.0.255
[sw1-ospf-1-area-0.0.0.1]network 10.1.3.0 0.0.0.255
[sw1-ospf-1-area-0.0.0.1]stub no-summary
[sw1-ospf-1]area 3
[sw1-ospf-1-area-0.0.0.3]net 10.1.100.0 0.0.0.255
[sw1-ospf-1-area-0.0.0.3]stub no-summary
[sw1]ospf 1 router-id 11.11.11.11
[sw1-ospf-1]area 1
[sw1-ospf-1-area-0.0.0.1]network 10.1.2.0 0.0.0.255
[sw1-ospf-1-area-0.0.0.1]network 10.1.3.0 0.0.0.255
[sw1-ospf-1-area-0.0.0.1]stub no
[sw1-ospf-1-area-0.0.0.1]stub no-summary
[sw1-ospf-1]area 3
[sw1-ospf-1-area-0.0.0.3]net 10.1.100.0 0.0.0.255
[sw1-ospf-1-area-0.0.0.3]stub no-summary
3.在PC1上对8.8.8.8即公网进行连通性测试:
对sever1进行连通性测试,发现无法连通,经检验为Bug,需删除vlan100线路。
实验完成