HCIP第一天(静态路由)
静态路由实验

1.R6为ISP,接口IP地址均为公有地址,该设备只能配置IP地址,之后不能再对其进行任何配置;
2.R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配;
3.所有路由器上环回均代表连接用户的接口;
4.R3下的两台pc通过DHCP获取IP地址;
5.选路最佳,路由表尽量小,避免环路;
6.R1-R5均可访问R6环回;
7.R6telnetR5的公有IP时,实际登录到R1上;
8.R4与R5正常通过1000链路,故障时通过100兆链路
1.R6为ISP,接口IP地址均为公有地址,该设备只能配置IP地址,之后不能再对其进行任何配置;
R6配置地址12.1.1.2 24后不进行其他任何配置
2…R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配;
子网划分(借三位2^3=8>5)
192.168.1.0/24
192.168.1.000 00000 /27 192.168.1.0/27
R1-R2
192.168.1.000 0 0000/28 192.168.1.0/28
R1环回
192.168.1.0001 0 000/29 192.168.1.16/29
192.168.1.0001 1 000/29 192.168.1.24/29
192.168.1.001 00000 /27 192.168.1.32/27
R2-R4
192.168.1.001 0 0000/28 192.168.1.32/28
R2环回
192.168.1.0011 0 000/29 192.168.1.48/29
192.168.1.0011 1 000/29 192.168.1.56/29
192.168.1.010 00000 /27 192.168.1.64/27
R1-R3
192.168.1.010 0 0000/28 192.168.1.64/28
R3pc
192.168.1.010 1 0000/28 192.168.1.80/28
192.168.1.011 00000 /27 192.168.1.96/27
R3-R4
192.168.1.011 0 0000/28 192.168.1.96/28
R4环回
192.168.1.0111 0 000/29 192.168.1.112/29
192.168.1.0111 1 000/29 192.168.1.120/29
192.168.1.100 00000 /27 192.168.1.128/27
R4-R5
192.168.1.100 0 0000/28 192.168.1.128/28
R5环回
192.168.1.100 1 0000/28 192.168.1.144/28
192.168.1.101 00000 /27 192.168.1.160/27
192.168.1.110 00000 /27 192.167.1.192.27
192.168.1.111 00000 /27 192.168.1.224.27
3.所有路由器上环回均代表连接用户的接口;
配置环回接口
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.17 29
[R1-LoopBack0]q
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.25 29
[R1-LoopBack1]q
4.R3下的两台pc通过DHCP获取IP地址;
路由器上进行dhcp配置
[R3]dhcp enable
[R3]ip pool xixi
[R3-ip-pool-xixi]network 192.168.1.80 mask 255.255.255.248
[R3-ip-pool-xixi]gateway-list 192.168.1.81
[R3-ip-pool-xixi]dns-list 8.8.8.8
[R3-ip-pool-xixi]q
[R3]interface g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
[R3-GigabitEthernet0/0/2]q
5.选路最佳,路由表尽量小,避免环路;
汇总
[R1]ip route-static 192.168.1.112 28 192.168.1.2
6.R1-R5均可访问R6环回;
①R1-R5均配置缺省路由
[R1]ip route-static 0.0.0.0 0 192.168.1.2
[R2]ip route-static 0.0.0.0 0 192.168.1.34
[R3]ip route-static 0.0.0.0 0 192.168.1.98
[R4]ip route-static 0.0.0.0 0 192.168.1.130
[R5]ip route-static 0.0.0.0 0 12.1.1.2
②R5边界路由器上配置nat进行地址转换
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R5-acl-basic-2000]q
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]nat outbound 2000
ping 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=252 time=330 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=252 time=250 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=252 time=260 ms
Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=252 time=450 ms
Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=252 time=340 ms
7.R6telnetR5的公有IP时,实际登录到R1上;
R5上配置nat
[R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.1 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y
[R5-GigabitEthernet0/0/1]q
R1上开启远程登录服务
[R1]aaa
[R1-aaa]local-user haha password cipher cisco
[R1-aaa]local-user haha service-type telnet
[R1-aaa]local-user haha privilege level 15
[R1-aaa]q
[R1]telnet server enable
Error: TELNET server has been enabled
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
R6telnetR5
telnet 12.1.1.1
Press CTRL_] to quit telnet mode
Trying 12.1.1.1 …
Connected to 12.1.1.1 …
Login authentication
Username:haha
Password:
User last login information:
Access Type: Telnet
IP-Address : 192.168.1.2
Time : 2020-09-24 10:50:50-08:00
8.R4与R5正常通过1000链路,故障时通过100 兆链路
浮动静态路由
[R4]ip route-static 192.168.1.144 28 192.168.1.162 preference 80
[R4]ip route-static 192.168.1.144 28 192.168.1.130 preference 50
该博客围绕HCIP第一天的静态路由实验展开。介绍了ISP和局域网路由器的IP地址配置、子网划分、环回接口设置、DHCP配置等内容。还涉及选路优化、缺省路由与NAT配置以实现内外网访问,以及浮动静态路由应对链路故障等关键技术。
870

被折叠的 条评论
为什么被折叠?



