静态路由综合实验

文章详细描述了一个网络实验,涉及R1至R6路由器的IP地址规划,使用DHCP为R3提供动态IP,配置静态路由以优化选路、避免环路,以及在边界路由器上实施NAT策略和端口映射,确保内部网络访问和远程登陆功能的实现。
摘要由CSDN通过智能技术生成

实验要求:

1、R6为ISP,接口IP地址均为公有地址;该设备只能配置IP地址,之后不能再对其进行任何配置;

2、R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配;

3、所有路由器上环回(R1、R2、R4分别有2两个环回,R5、R6有一个环回),均代表连接用户的接口;

4、R3下的两台PC通过DHCP自动获取IP地址;

5、选路最佳,路由表尽量小,避免环路;

6、R1-R5均可访问R6的环回

7、R6telnetR5的公有IP地址时,实际登录到R1上

8、R4与R5正常通过1000m链路,故障时通过100m链路。

第一步、规划IP地址并配置。

192.168.1.0/24借三位化为8个网段,用前六个网段。

①192.168.1.0/27(骨干链路)

再借到30位,分给链路

192.168.1.0/30

192.168.1.4/30

192.168.1.8/30

192.168.1.12/30

192.168.1.16/30

192.168.1.20/30

②192.168.1.32/27(R1)

再借一位

192.168.1.32/28

192.168.1.48/28

③192.168.1.64/27(R2)

再借一位

192.168.1.64/28

192.168.1.80/28

④192.168.1.96/27(R3)

⑤192.168.1.128/27(R4)

再借一位

192.168.1.128/28

192.168.1.144/28

⑥192.168.1.160/27(R5)

第二步、给R3配置DHCP。

[R3]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[R3]ip pool a
Info: It's successful to create an IP address pool.
[R3-ip-pool-a]network 192.168.1.96 mask 27
[R3-ip-pool-a]gateway-list 192.168.1.97  
[R3-ip-pool-a]q
[R3]interface g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global

第三步、写静态路由。因为路由表尽量小,所以R1\R2\R3上直接写缺省路由。R4\R5上补充一些到不了的路由。修改路由优先级,同时也完成要求8。

[R1]ip route-static 0.0.0.0 0 192.168.1.2
[R1]ip route-static 0.0.0.0 0 192.168.1.10

[R2]ip route-static 0.0.0.0 0 192.168.1.6

[R3]ip route-static 0.0.0.0 0 192.168.1.14

[R4]ip route-static 0.0.0.0 0 192.168.1.18    
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
[R4]ip route-static 192.168.1.32 27 192.168.1.5
[R4]ip route-static 192.168.1.64 27 192.168.1.5
[R4]ip route-static 192.168.1.32 27 192.168.1.13
[R4]ip route-static 192.168.1.96 27 192.168.1.13
[R4]ip route-static 192.168.1.0 30 192.168.1.5  
[R4]ip route-static 192.168.1.8 30 192.168.1.13

[R5]ip route-static 0.0.0.0 0 56.0.0.2
[R5]ip route-static 192.168.1.32 27 192.168.1.17
[R5]ip route-static 192.168.1.64 27 192.168.1.17
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.128 27 192.168.1.17
[R5]ip route-static 192.168.1.0 30 192.168.1.17  
[R5]ip route-static 192.168.1.4 30 192.168.1.17
[R5]ip route-static 192.168.1.8 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 192.168.1.32 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.64 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.96 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.128 27 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.0 30 192.168.1.21 preference 61  
[R5]ip route-static 192.168.1.4 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.8 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.12 30 192.168.1.21 preference 61

第四步、避免环路产生,在路由汇总的路由器上写空接口防环。

[R1]ip route-static 192.168.1.32 27 NULL 0

[R2]ip route-static 192.168.1.64 27 NULL 0

[R3]ip route-static 192.168.1.96 27 NULL 0

[R4]ip route-static 192.168.1.128 27 NULL 0

[R5]ip route-static 192.168.1.160 27 NULL 0

第五步、在边界路由器做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-GigabitEthernet0/0/1]nat outbound 2000

第六步、在R1上开启telnet远程登陆。

[R1]aaa
[R1-aaa]local-user user1 password cipher 123
Info: Add a new user.
[R1-aaa]local-user user1 service-type telnet
[R1]user-interface vty 0 4 
[R1-ui-vty0-4]authentication-mode aaa

第七步、在R5的公网接口做端口映射

[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]nat static protocol tcp global current-interface 23 inside 192.168.1.1 23
Warning:The port 23 is well-known port. If you continue it may cause function failure.
Are you sure to continue?[Y/N]:y

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

麦农111

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值