hcip静态路由实验

hcip静态路由实验_第1张图片

1、实验需求

1 R6为isp,接口IP地址均为公有地址;该设备只能配置IP地址,之后不能冉对其进行其他任何配置;
2 R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配;
3 R1,R2,R4,各有两个环回地址;R5,R6各有一个环回地址;所有路由器上环回均代表连接用户的接口;
4 R3下的两台pc通过DHCP自动获取IP地址;
5 选路最佳,路由表尽量小,避免环路;
6 R1-R5均可以访问R6的环回;
7 R6telnetR5的公有IP地址时,实际登陆到R1上;
8 R4与R5正常通过1000M链路,故障时通过100M链路;
2、配置内容

r1:

interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.252
interface GigabitEthernet0/0/1
ip address 192.168.1.5 255.255.255.252
interface LoopBack0
ip address 192.168.1.33 255.255.255.240
interface LoopBack1
ip address 192.168.1.49 255.255.255.240
ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
ip route-static 0.0.0.0 0.0.0.0 192.168.1.6
aaa
local-user lm privilege level 15 password cipher 123456
local-user panxi service-type telnet
user-interface vty 0 4
authentication-mode aaa

r2

[r2]int LoopBack 0
[r2-LoopBack0]ip add 192.168.1.97 28
[r2-LoopBack0]q
[r2]int l
[r2]int LoopBack 1
[r2-LoopBack1]ip add 192.168.1.113 28
[r2-LoopBack1]q
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
ip route-static 0.0.0.0 0.0.0.0 192.168.1.10

r3

[r1]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
[r3-GigabitEthernet0/0/1]int g0/0/2
[r3-GigabitEthernet0/0/2]ip add 192.168.1.65 27
dhcp enable
ip pool a
network 192.168.1.64 mask 255.255.255.224
gateway-list 192.168.1.65
dns-list 114.114.114.114 8.8.8.8
int g0/0/2
dhcp select global
ip route-static 0.0.0.0 0 192.168.1.14

r4

[r4]int LoopBack 0
[r4-LoopBack0]ip add 192.168.1.129 28
[r4]int LoopBack 1
[r4-LoopBack1]ip add 192.168.1.145 28
[r4-LoopBack1]q
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
[r4-GigabitEthernet0/0/1]ip add 192.168.1.14 30
[r4-GigabitEthernet4/0/0]ip add 192.168.1.29 30
[r4-GigabitEthernet0/0/2]ip add 192.168.1.17 30
ip route-static 0.0.0.0 0 192.168.1.18
ip route-static 0.0.0.0 0 192.168.1.30 preference 61
ip route-static 192.168.1.96 255.255.255.224 192.168.1.9
[r4]ip route-static 192.168.1.32 255.255.255.224 192.168.1.9
[r4]ip route-static 192.168.1.32 255.255.255.224 192.168.1.11
[r4]ip route-static 192.168.1.64 255.255.255.224 192.168.1.11
[r4]ip route-static 192.168.1.0 255.255.255.252 192.168.1.9
[r4]ip route-static 192.168.1.4 255.255.255.252 192.168.1.9
[r4]undo ip route-static 192.168.1.4 255.255.255.252 192.168.1.9
[r4]undo ip route-static 192.168.1.32 255.255.255.224 192.168.1.11
[r4]undo ip route-static 192.168.1.64 255.255.255.224 192.168.1.11
[r4]ip route-static 192.168.1.4 255.255.255.252 192.168.1.13
[r4]ip route-static 192.168.1.32 255.255.255.224 192.168.1.13
[r4]ip route-static 192.168.1.64 255.255.255.224 192.168.1.13
/ip route-static 0.0.0.0 0 g0/0/2 192.168.1.18

r5

interface GigabitEthernet0/0/0
ip address 192.168.1.18 255.255.255.252
interface GigabitEthernet0/0/1
ip address 12.1.1.1 255.255.255.0
interface GigabitEthernet0/0/2
ip address 192.168.1.30 255.255.255.252
interface LoopBack0
ip address 192.168.1.161 255.255.255.224
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
ip route-static 192.168.1.0 255.255.255.252 192.168.1.17
ip route-static 192.168.1.0 255.255.255.252 192.168.1.29 preference 61
ip route-static 192.168.1.4 255.255.255.252 192.168.1.29 preference 61
ip route-static 192.168.1.4 255.255.255.252 192.168.1.17
ip route-static 192.168.1.8 255.255.255.252 192.168.1.17
ip route-static 192.168.1.8 255.255.255.252 192.168.1.29 preference 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.29 preference 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.17
ip route-static 192.168.1.32 255.255.255.224 192.168.1.17
ip route-static 192.168.1.32 255.255.255.224 192.168.1.29 preference 61
ip route-static 192.168.1.64 255.255.255.224 192.168.1.29 preference 61
ip route-static 192.168.1.64 255.255.255.224 192.168.1.17
ip route-static 192.168.1.96 255.255.255.224 192.168.1.17
ip route-static 192.168.1.96 255.255.255.224 192.168.1.29 preference 61
ip route-static 192.168.1.128 255.255.255.224 192.168.1.29 preference 61
ip route-static 192.168.1.128 255.255.255.224 192.168.1.17
或者ip route-static 192.168.1.0 24 192.168.1.17
ip route-static 192.168.1.0 24 192.168.1.17 preference 61
acl 2000
rule permit source 192.168.1.0 0.0.0.255
nat server protocol tcp global current-interface telnet inside 192.168.1.1 telnet
nat outbound 2000

r6

int LoopBack 0
[r6-LoopBack0]ip add 1.1.1.1 24
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 12.1.1.2 24
最后,每个路由器写空接口防环。
r1
ip route-static 192.168.1.32 27 null 0
其他路由器同理

实验结果:

hcip静态路由实验_第2张图片

你可能感兴趣的:(网络,智能路由器,运维)