目录
题目
拓扑设计以及IP地址的划分
配置环回IP
R1
[r1]int lo0
[r1-LoopBack0]ip add 192.168.0.1 30
[r1-LoopBack0]int lo1
[r1-LoopBack1]ip add 192.168.0.5 30
[r1-LoopBack1]int lo2
[r1-LoopBack2]ip add 192.168.0.9 30
配置IP 地址
R1
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.0.49 28
[r1-GigabitEthernet0/0/1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.169.0.17 28
R2
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.0.18 28
Jul 17 2022 18:02:11-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.0.33 28
Jul 17 2022 18:02:27-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[Huawei-GigabitEthernet0/0/1]
R3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.0.50 28
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.0.65 28
R4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.0.66 28
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.0.34 28
[r4-GigabitEthernet0/0/1]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 192.168.0.113 28
[r4-GigabitEthernet0/0/2]int g4/0/0
[r4-GigabitEthernet4/0/0]ip add 192.168.0.97 28
R5
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.0.114 28
[r5-GigabitEthernet0/0/0]int g0/0/1
[r5-GigabitEthernet0/0/1]ip add 192.168.0.98 28
[r5]int g0/0/2
[r5-GigabitEthernet0/0/2]ip add 100.1.1.2 24
R6
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 100.1.1.1 24
给R1做路由汇总
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]rip summary-address 192.168.0.0 255.255.255.240
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]rip summary-address 192.168.0.0 255.255.255.240
做完汇总要做一个空接口
[r1]ip route-static 192.168.0.0 28 NULL 0
创建VLAN并配置
SW1
[sw1]vlan 2
[sw1-vlan2]q
[sw1]vlan 3
[sw1-vlan3]q
[sw1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 2
[sw1-Ethernet0/0/2]int e0/0/3
[sw1-Ethernet0/0/3]port link-type access
[sw1-Ethernet0/0/3]port default vlan 3
设置trunk干道
[sw1-Ethernet0/0/3]int e0/0/4
[sw1-Ethernet0/0/4]port link-type trunk
[sw1-Ethernet0/0/4]port trunk allow-pass vlan 2 to 3
[sw1-Ethernet0/0/4]int e0/0/1
[sw1-Ethernet0/0/1]port link-type trunk
[sw1-Ethernet0/0/1]port trunk allow-pass vlan 2 to 3
SW2
[sw2]vlan 2
[sw2-vlan2]vlan 2
[sw2-vlan2]q
[sw2]vlan 3
[sw2-vlan3]
[sw2]int e0/0/2
[sw2-Ethernet0/0/2]p l a
[sw2-Ethernet0/0/2]p d v 2
[sw2-Ethernet0/0/2]int e0/0/3
[sw2-Ethernet0/0/3]p l a
[sw2-Ethernet0/0/3]p d v 3
设置trunk干道
[sw2]int e0/0/1
[sw2-Ethernet0/0/1]port link-type trunk
[sw2-Ethernet0/0/1]port trunk allow-pass vlan 2 to 3
配置路由器子接口
R3
[r3]int g0/0/2.1
[r3-GigabitEthernet0/0/2.1]ip add 192.168.0.81 28
[r3-GigabitEthernet0/0/2.1]dot1q termination vid 3
[r3-GigabitEthernet0/0/2.1]arp broadcast enable
[r3-GigabitEthernet0/0/2.1]int g0/0/2.2
[r3-GigabitEthernet0/0/2.2]ip add 192.168.0.129 28
[r3-GigabitEthernet0/0/2.2]dot1q termination vid 2
[r3-GigabitEthernet0/0/2.2]arp broadcast enable
配置静态路由
AR1
[r1]ip route-static 192.168.0.32 28 192.168.0.18
[r1]ip route-static 192.168.0.64 28 192.168.0.50
[r1]ip route-static 192.168.0.96 28 192.168.0.50
[r1]ip route-static 192.168.0.96 28 192.168.0.18
[r1]ip route-static 192.168.0.112 28 192.168.0.18
[r1]ip route-static 192.168.0.112 28 192.168.0.50
[r1]ip route-static 192.168.0.80 28 192.168.0.50
[r1]ip route-static 192.168.0.128 28 19.168.0.50
AR2
[r2]ip route-static 192.168.0.0 28 192.168.0.17
[r2]ip route-static 192.168.0.48 28 192.168.0.17
[r2]ip route-static 192.168.0.64 28 192.168.0.34
[r2]ip route-static 192.168.0.96 28 192.168.0.34
[r2]ip route-static 192.168.0.112 28 192.168.0.34
[r2]ip route-static 192.168.0.80 28 192.168.0.17
[r2]ip route-static 192.168.0.80 28 192.168.0.34
[r2]ip route-static 192.168.0.128 28 192.168.0.17
[r2]ip route-static 192.168.0.128 28 192.168.0.34
AR3
[r3]ip route-static 192.168.0.0 28 192.168.0.49
[r3]ip route-static 192.168.0.16 28 192.168.0.49
[r3]ip route-static 192.168.0.32 28 192.168.0.66
[r3]ip route-static 192.168.0.96 28 192.168.0.66
[r3]ip route-static 192.168.0.112 28 192.168.0.66
AR4
[r4]ip route-static 192.168.0.0 28 192.168.0.33
[r4]ip route-static 192.168.0.0 28 192.168.0.65
[r4]ip route-static 192.168.0.16 28 192.168.0.33
[r4]ip route-static 192.168.0.48 28 192.168.0.65
[r4]ip route-static 192.168.0.128 28 192.168.0.65
[r4]ip route-static 192.168.0.80 28 192.168.0.65
AR5
[r5]ip route-static 192.168.0.0 28 192.168.0.97
[r5]ip route-static 192.168.0.0 28 192.168.0.113
[r5]ip route-static 192.168.0.16 28 192.168.0.97
[r5]ip route-static 192.168.0.16 28 192.168.0.113
[r5]ip route-static 192.168.0.48 28 192.168.0.97
[r5]ip route-static 192.168.0.48 28 192.168.0.113
[r5]ip route-static 192.168.0.32 28 192.168.0.97
[r5]ip route-static 192.168.0.32 28 192.168.0.113
[r5]ip route-static 192.168.0.64 28 192.168.0.97
[r5]ip route-static 192.168.0.64 28 192.168.0.113
[r5]ip route-static 192.168.0.80 28 192.168.0.97
[r5]ip route-static 192.168.0.80 28 192.168.0.113
[r5]ip route-static 192.168.0.128 28 192.168.0.97
[r5]ip route-static 192.168.0.128 28 192.168.0.113
配置缺省路由
[r1]ip route-static 0.0.0.0 0.0.0.0 192.168.0.18
[r1]ip route-static 0.0.0.0 0.0.0.0 192.168.0.50
[r2]ip route-static 0.0.0.0 0.0.0.0 192.168.0.34
[r3]ip route-static 0.0.0.0 0.0.0.0 192.168.0.66
[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.0.98
[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.0.114
端口地址转换
[r5]acl 2000
[r5-acl-basic-2000]rule permit source any
[r5-acl-basic-2000]int g0/0/2
[r5-GigabitEthernet0/0/2]nat outbound 2000
浮动静态
ip route-static 100.1.1.0 24 192.168.0.98 preference 61
测试