写网关
r1
<Huawei>system-view
[Huawei]sysname r1
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1]interface g 0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.3.1 24
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 172.16.1.1 24
[r1-LoopBack0]q
[r1]interface LoopBack 1
[r1-LoopBack1]ip address 172.16.2.1 24
[r1-LoopBack1]q
[r1]interface LoopBack 2
[r1-LoopBack2]ip address 172.16.3.1 24
r2
[r2]interface g 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 24
[r2-GigabitEthernet0/0/0]q
[r2]interface g 0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.2.1 24
同理,r3,r4,r5,r6,r7。。。。。
1.使用合理IP地址规划网络,各自创建环回接口
2.R1创建环回 172.16.1.1/24 172.16.2.1/24 172.16.3.1/24
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 172.16.1.1 24
[r1-LoopBack0]q
[r1]interface LoopBack 1
[r1-LoopBack1]ip address 172.16.2.1 24
[r1-LoopBack1]q
[r1]interface LoopBack 2
[r1-LoopBack2]ip address 172.16.3.1 24
[r2]interface LoopBack 0
[r2-LoopBack0]ip add
[r2-LoopBack0]ip address 2.2.2.2 24
[r3]interface LoopBack 0
[r3-LoopBack0]ip add
[r3-LoopBack0]ip address 3.3.3.3 24
[r4]interface LoopBack 0
[r4-LoopBack0]ip add
[r4-LoopBack0]ip address 4.4.4.4 24
[r5]interface LoopBack 0
[r5-LoopBack0]ip add
[r5-LoopBack0]ip address 5.5.5.5 24
[r6]interface LoopBack 0
[r6-LoopBack0]ip add
[r6-LoopBack0]ip address 6.6.6.6 24
[r7]interface LoopBack 0
[r7-LoopBack0]ip add
[r7-LoopBack0]ip address 7.7.7.7 24
写rip
r1
[r1]rip 100
[r1-rip-100]version 2
[r1-rip-100]undo summary
[r1-rip-100]network 172.16.0.0
[r1-rip-100]network 192.168.1.0
[r1-rip-100]network 192.168.3.0
r2,r3,r4,r5一样
r6,r7把版本号改为1
3.要求R3使用R2访问R1环回
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r3-acl-basic-2000]in g0/0/0
[r3-GigabitEthernet0/0/0]rip metricin 2000 3
4.减少路由条目数量,
[r1]in g0/0/0
[r1-GigabitEthernet0/0/0]rip split-horizon
[r1-GigabitEthernet0/0/0]rip summary-address 172.16.0.0 255.255.252.0
[r1-GigabitEthernet0/0/0]in g0/0/1
[r1-GigabitEthernet0/0/1]rip summary-address 172.16.0.0 255.255.252.0
防止路由黑洞
[r1]ip route-static 172.16.0.0 22 null 0
R1-R2之间增加路由传递安全性
[r1]interface g 0/0/0
[r1-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 111
[r2]interface g 0/0/0
[r2-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 111
5.R5创建一个环回模拟运营商,不能通告
[r5]interface LoopBack 0
[r5-LoopBack0]ip add
[r5-LoopBack0]ip address 5.5.5.5 24
#不宣告5.5.5.5
6.R1 telnet R2环回实际telnet 到R7上
[r7] aaa
[r7-aaa]local-user obboda privilege level 15 password cipher obboda7452 Info: Add a new user.
[r7-aaa]local-user obboda service-type telnet
[r7-aaa]user-interface vty 0 4
[r7-ui-vty0-4]authentication-mode aaa
[r2-GigabitEthernet0/0/0]nat server protocol tcp global interface loopback 0 23
inside 7.7.7.7 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
[r2-GigabitEthernet0/0/0]
<r1>telnet 2.2.2.2
Press CTRL ] to quit telnet mode Trying 2.2.2.2 ...
Connected to 2.2 . 2.2 ...
Login authentication
Username:obboda Password:
<r7>
7.R6-R7路由器不能学习到达R1环回路由
[r4]acl 2001
[r4-acl-basic-2001]rule deny source 172.16.2.0 0.0.3.255
[r4-acl-basic-2001]rule permit source any
[r4-acl-basic-2001]q
[r4] rip 100
[r4-rip-100]filter-policy 2001 export g3/0/0