静态路由总结实验
空间霸气留言
按照静态配置的步骤,第⼀步分配ip,第⼆步配ip,第三步按照要求去进⾏配置
1.分配IP,⼀共是6个⾻⼲,7个环回和⼀个dhcp⽹段,分配好了如下图
接下来开始配ip
1[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30 2[r1-GigabitEthernet0/0/1]ip add 192.168.1.5 30 3[r1-LoopBack0]ip add 192.168.1.65 30
4[r1-LoopBack1]ip add 192.168.1.81 30
5
6[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30 7[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30 8[r2-LoopBack0]ip add 192.168.1.129 30
9[r2-LoopBack1]ip add 192.168.1.145 30
10
11[r3-GigabitEthernet0/0/0]ip add 192.168.1.13 30 12[r3-GigabitEthernet0/0/1]ip add 192.168.1.6 30 13[r3-GigabitEthernet0/0/2]ip add 192.168.1.97 29 14姚星彤个人资料
15[r4-GigabitEthernet0/0/0]ip add 192.168.1.10 30 16[r4-GigabitEthernet0/0/1]ip add 192.168.1.14 3
0 17[r4-GigabitEthernet0/0/2]ip add 192.168.1.17 30 18[r4-GigabitEthernet4/0/0]ip add 192.168.1.33 30 19[r4-LoopBack0]ip add 192.168.1.161 30
20[r4-LoopBack1]ip add 192.168.1.177 30
21
22[r5-GigabitEthernet0/0/0]ip add 192.168.1.18 30 23[r5-GigabitEthernet0/0/1]ip add 192.168.1.34 30 24[r5-LoopBack0]ip add 192.168.1.193 30
25[r5-GigabitEthernet0/0/2]ip add 12.0.0.1 24
26
27[isp-GigabitEthernet0/0/0]ip add 12.0.0.2 24
28[isp-LoopBack0]ip add 1.1.1.1 24
地址已经全部配好了,接下来就是配置静态路由和缺省路由
1---R1
2ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
3ip route-static 0.0.0.0 0.0.0.0 192.168.1.6
4ip route-static 192.168.1.8 255.255.255.252 192.168.1.2
5ip route-static 192.168.1.12 255.255.255.252 192.168.1.6
6ip route-static 192.168.1.96 255.255.255.248 192.168.1.6
7ip route-static 192.168.1.128 255.255.255.224 192.168.1.2
8---R2
9ip route-static 0.0.0.0 0.0.0.0 192.168.1.10
10ip route-static 192.168.1.4 255.255.255.252 192.168.1.1
11ip route-static 192.168.1.64 255.255.255.224 192.168.1.1
12ip route-static 192.168.1.96 255.255.255.248 192.168.1.1
13ip route-static 192.168.1.96 255.255.255.248 192.168.1.10
14---R3
15ip route-static 0.0.0.0 0.0.0.0 192.168.1.14
16ip route-static 192.168.1.0 255.255.255.252 192.168.1.5
适合农村的致富项目
17ip route-static 192.168.1.64 255.255.255.224 192.168.1.5
18ip route-static 192.168.1.128 255.255.255.224 192.168.1.5
19ip route-static 192.168.1.128 255.255.255.224 192.168.1.14
女人梦见狗是什么预兆20---R4
21ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/2 192.168.1.18
22ip route-static 0.0.0.0 0.0.0.0 192.168.1.34 preference 70
23ip route-static 192.168.1.0 255.255.255.252 192.168.1.9
24ip route-static 192.168.1.4 255.255.255.252 192.168.1.13
25ip route-static 192.168.1.64 255.255.255.224 192.168.1.9
26ip route-static 192.168.1.64 255.255.255.224 192.168.1.13
27ip route-static 192.168.1.96 255.255.255.248 192.168.1.13
28ip route-static 192.168.1.128 255.255.255.224 192.168.1.9
29---R5
30ip route-static 192.168.1.0 255.255.255.0 192.168.1.17
31ip route-static 192.168.1.0 255.255.255.0 192.168.1.33 preference 70
因为为了减少路由条⽬,我们写很多路由条⽬的时候都进⾏了汇总,所以要在每⼀个路由器上⾯配置空接⼝(因为r2使⽤的是动态路由分配ip,所以不⽤配置空接⼝)
1[r1]ip route-static 192.168.1.64 27 NULL 0
2[r3]ip route-static 192.168.1.128 27 NULL 0
3[r4]ip route-static 192.168.1.0 24 NULL 0
4[r5]ip route-static 192.168.1.0 24 NULL 0
好了,然后尝试⽤r1ping⼀下r5的环回,如果能通基本上内⽹就全⽹可达
1<r1>ping 192.168.1.193
2  PING 192.168.1.193: 56  data bytes, press CTRL_C to break
3    Request time out
4    Reply from 192.168.1.193: bytes=56 Sequence=2 ttl=253 time=50 ms
巴西龙骨
5    Reply from 192.168.1.193: bytes=5
6 Sequence=3 ttl=253 time=40 ms
6    Reply from 192.168.1.193: bytes=56 Sequence=4 ttl=253 time=30 ms
7    Reply from 192.168.1.193: bytes=56 Sequence=5 ttl=253 time=30 ms
还差⼀个r3的dhcp没有做,现在做⼀下
1[r3]dhcp enable
2[r3]ip pool aa
3Info: It's successful to create an IP address pool.
4[r3-ip-pool-aa]network 192.168.1.96 mask 29
5[r3-ip-pool-aa]gateway-list 192.168.1.97
6[r3-GigabitEthernet0/0/2]dhcp select global港人评价郭晶晶
检查⼀下,电脑已经分配了ip,没有任何问题,接下来把r5作为内⽹的边界路由器进⾏nat配置
1[r5]access-user
2[r5]acl 2000
3[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
4[r5-GigabitEthernet0/0/2]nat outbound 2000
5
6测试:
7<r1>ping 1.1.1.1
8  PING 1.1.1.1: 56  data bytes, press CTRL_C to break
9    Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=252 time=40 ms
10    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=252 time=30 ms
11    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=252 time=30 ms
完⼯