实验要求:
1.使用172.16.0.0/16划分网络
2.使用ospf协议合理规划区域保证更新安全
3.加快收敛速度
4.router1为DR没有BDR
5.pc2345自动获取ip地址
pc1为外网pc要求可以互相访问
6.router7为运营商只能配置ip地址
7.pc1远程登录router7实际登录router4
8.pc4可以ping通router6但不能登录router6
9.pc3可以ping通pc5但pc5不能ping通pc3
拓扑图如下:
进行基本的网络配置
以r1为例:
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 1.1.1.1 32
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 172.16.0.1 27
Nov 26 2022 16:01:39-08:00 r1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]ip address 172.16.0.65 27
Nov 26 2022 16:02:01-08:00 r1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
1.划分网络
172.16.0.0/16划分4个网段,借2位,变成172.16.0.0/18,划分出的四个网段是
172.16.0.0/18 area0
172.16.0.64/18 area1
172.16.0.128/18 area2
172.16.0.192/18 area3
出现问题,原因:每个大网段中主机数太多。解决方法:再进行网络划分
划分512个网段,取用前四个
即172.16.0.0/27 area0
172.16.0.64/27 area1
172.16.0.128/27 area2
172.16.0.192/27 area3
2.ospf划分区域并保证更新安全
划分区域:
[r1]ospf 1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]network 172.16.0.65 0.0.0.0
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[r2-ospf-1]area 2
[r2-ospf-1-area-0.0.0.2]network 172.16.0.129 0.0.0.0
[r3]ospf 1
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 172.16.0.3 0.0.0.0
[r3-ospf-1]area 3
[r3-ospf-1-area-0.0.0.3]network 172.16.0.193 0.0.0.0
[r4]ospf 1
[r4-ospf-1]area 3
[r4-ospf-1-area-0.0.0.3]network 0.0.0.0 255.255.255.255
[r5]ospf 1
[r5-ospf-1]area 1
[r5-ospf-1-area-0.0.0.1]network 172.16.0.66 0.0.0.0
[r7]ospf 1
[r7-ospf-1]area 2
[r7-ospf-1-area-0.0.0.2]network 0.0.0.0 255.255.255.255
保证更新安全。即区域认证
[r1]ospf 1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]authentication-mode simple cipher 123
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]authentication-mode simple cipher 123
[r2]ospf 1
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]authentication-mode simple cipher 123
[r2-ospf-1]area 2
[r2-ospf-1-area-0.0.0.2]authentication-mode simple cipher 123
[r3]OSPF 1
[r3-ospf-1]AREA 0
[r3-ospf-1-area-0.0.0.0]authentication-mode simple cipher 123
[r3-ospf-1]area 3
[r3-ospf-1-area-0.0.0.3]authentication-mode simple cipher 123
[r4]ospf 1
[r4-ospf-1]area 3
[r4-ospf-1-area-0.0.0.3]authentication-mode simple cipher 123
[r5-ospf-1]area 1
[r5-ospf-1-area-0.0.0.1]authentication-mode simple cipher 123
[r7]ospf 1
[r7-ospf-1]area 2
[r7-ospf-1-area-0.0.0.2]authentication-mode simple cipher 123
3.加快收敛速度
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ospf timer hello 5
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]ospf timer hello 5
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ospf timer hello 5
[r2]interface g0/0/1
[r2-GigabitEthernet0/0/1]ospf timer hello 5
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ospf timer hello 5
[r3]interface g0/0/1
[r3-GigabitEthernet0/0/1]ospf timer hello 5
[r4]interface g0/0/0
[r4-GigabitEthernet0/0/0]ospf timer hello 5
[r4]interface g0/0/1
[r4-GigabitEthernet0/0/1]ospf timer hello 5
[r5]interface G0/0/0
[r5-GigabitEthernet0/0/0]ospf timer hello 5
[r7-GigabitEthernet0/0/0]ospf timer hello
[r7]interface g0/0/1
[r7-GigabitEthernet0/0/1]ospf timer hello 5
5.pc自动获取IP地址,以r7为例
先在交换机2上创建vlan
[Huawei]vlan batch 2 3
[Huawei]interface e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 2
[Huawei]interface e0/0/3
[Huawei-Ethernet0/0/3]port link-type access
[Huawei-Ethernet0/0/3]port default vlan 3
[Huawei]interface e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
在r7上创建dhcp
[r7]dhcp enable
[r7]interface g0/0/1.1
[r7-GigabitEthernet0/0/1.1]dot1q termination vid 2
[r7-GigabitEthernet0/0/1.1]ip address 192.168.1.1 24
[r7]interface g0/0/1.2
[r7-GigabitEthernet0/0/1.2]dot1q termination vid 3
[r7-GigabitEthernet0/0/1.2]ip address 192.168.2.1 24
[r7]ip pool 1
Info: It's successful to create an IP address pool.
[r7-ip-pool-1]network 192.168.1.0 mask 24
[r7-ip-pool-1]gateway-list 192.168.1.1
[r7-ip-pool-1]dns-list 8.8.8.8
[r7]ip pool 2
Info: It's successful to create an IP address pool.
[r7-ip-pool-2]network 192.168.2.0 mask 24
[r7-ip-pool-2]gateway-list 192.168.2.1
[r7-ip-pool-2]dns-list 8.8.8.8
[r7]interface g0/0/1.1
[r7-GigabitEthernet0/0/1.1]dhcp select global
[r7-GigabitEthernet0/0/1.1]arp broadcast enable
[r7]interface g0/0/1.2
[r7-GigabitEthernet0/0/1.2]dhcp select global
[r7-GigabitEthernet0/0/1.2]arp broadcast enable
同理在交换机3即r4上进行一系列配置
[Huawei]vlan batch 4 5
[Huawei]interface e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 4
[Huawei]interface e0/0/3
[Huawei-Ethernet0/0/3]port link-type access
[Huawei-Ethernet0/0/3]port default vlan 5
[Huawei]interface e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all//在交换机上配置
[r4]dhcp enable
[r4]interface g0/0/1.1
[r4-GigabitEthernet0/0/1.1]dot1q termination vid 4
[r4]ip pool 1
[r4-ip-pool-1]network 192.168.3.0 mask 24
[r4-ip-pool-1]gateway-list 192.168.3.1
[r4-ip-pool-1]dns-list 8.8.8.8
[r4]interface g0/0/1.2
[r4-GigabitEthernet0/0/1.2]dot1q termination vid 5
[r4-GigabitEthernet0/0/1.2]ip address 192.168.4.1 24
[r4]ip pool 2
[r4-ip-pool-2]network 192.168.4.0 mask 24
[r4-ip-pool-2]gateway-list 192.168.4.1
[r4-ip-pool-2]dns-list 8.8.8.8
[r4]interface g0/0/1.1
[r4-GigabitEthernet0/0/1.1]dhcp select global
[r4-GigabitEthernet0/0/1.1]arp broadcast enable
[r4]interface g0/0/1.2
[r4-GigabitEthernet0/0/1.2]dhcp select global
[r4-GigabitEthernet0/0/1.2]arp broadcast enable //在r4上配置
8.pc4可以ping通r6但不能登录r6
[r4]acl 3000
[r4-acl-adv-3000]rule deny tcp source 192.168.3.1 0.0.0.0 destination 10.1.1.2 0
.0.0.0 destination-port eq 23
[r4]interface g0/0/1.1
[r4-GigabitEthernet0/0/1.1]traffic-filter inbound acl 3000
pc1远程登录r7
[r5]user-interface vty 0 4
[r5-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):123
[r5]aaa
[r5-aaa]local-user xx privilege level 15 password cipher 123
Info: Add a new user.
[r5-aaa]local-user xx service-type telnet
[r5]user
[r5]user-interface vty 0 4
9.pc5ping不通pc3,即干掉去的流量
[r4]acl 3000
[r4-acl-adv-3000]rule deny icmp source 192.168.4.254 0.0.0.0 destination 192.168
.2.254 0.0.0.0 icmp-type echo
[r4]interface g0/0/1
[r4-GigabitEthernet0/0/1]traffic-filter inbound acl 3000
特别说明:本实验中的要求可达均已在基本配置中完成
以下是结果的显示
pc4通pc6
pc3通pc5
以下是所有操作的结果显示.
规划区域且进行加密:
加快收敛速度且r1为dr,无bdr
pc2345自动获取ip地址
pc1为外网要求可以互相访问:
7.r7为运营商只配置ip地址:
8.pc4可以ping通r6但不能登录r6