实验拓扑图如下
一、配置底层IP
如图按照划分好的地址配置
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[r1]interface LoopBack 0
[r1-LoopBack0]ip add 1.1.1.1 32
二、全网可达,rip(v1和v2)图中r2-7使用v2,r8、r9使用v1
在各个路由器上做RIP,
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 2.0.0.0
[r2-rip-1]network 192.168.1.0
[r2-rip-1]network 12.0.0.0
在r6上做V1和V2的兼容,此时r2-9可达
[R6]interface g0/0/0
[R6-GigabitEthernet0/0/0]rip version 1
连通外网 (缺省,NAT)此时全网可达,可连通外网
[r2]ip route-static 0.0.0.0 0 12.1.1.1
[r2]rip 1
[r2-rip-1]default-route originate //下放缺省路由[r2]acl 2000
[r2-acl-basic-2000]rule permit source any
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]nat outbound 2000 //多对一NAT
人为干涉选路,先抓取流量再增加cost值
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 7.7.7.7 0.0.0.0
[r3-acl-basic-2000]rule permit source 7.7.7.7 0.0.0.0
[r3-acl-basic-2000]qu
[r3]interface g0/0/1
[r3-GigabitEthernet0/0/1]rip metricin 2000 6
开启远程登陆并转换远程登录
[r2]user-interface vty 0 4
[r2-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):123[r9]user-interface vty 0 4
[r9-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):123[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]nat server protocol tcp global 12.1.1.3 23 inside 172.1
6.128.2 23