[R1]aaa
[R1-aaa]local-user TMG password cipher huawei #创建一个名TMG的用户,密码huawei
Info: Add a new user.
[R1-aaa]local-user TMG privilege level 15 #设置权限
[R1-aaa]local-user TMG service-type terminal #设为本地登录,还可以设为远程登录telnet
[R1]user-in co 0 #进入console口
[R1-ui-console0]authentication-mode aaa #调用aaa
? ? ? ? 1.划分广播域
? ? ? ? 2.连接不同的网络
? ? ? ? 3.路由---选路
[R3]ip route-static 192.168.1.0 24 192.168.4.1
[R3]ip route-static 192.168.2.0 24 192.168.4.1
[R3]ip route-static 192.168.3.0 24 192.168.4.1
[R3]dis ip ro pr s
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
Destinations : 3 Routes : 3 Configured Routes : 3
Static routing table status : <Active>
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 Static 60 0 RD 192.168.4.1 GigabitEthernet
0/0/1
192.168.2.0/24 Static 60 0 RD 192.168.4.1 GigabitEthernet
0/0/1
192.168.3.0/24 Static 60 0 RD 192.168.4.1 GigabitEthernet
0/0/1
[R3]ip route-static 192.168.0.0 22 192.168.4.1
[R3]dis ip ro pr s #查看静态路由表
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
Destinations : 1 Routes : 1 Configured Routes : 1
Static routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.0.0/22 Static 60 0 RD 192.168.4.1 GigabitEthernet
0/0/1
[R3]ip route-static 192.168.0.0 22 NULL 0 #最后在写上空接口防环路由
[R1]ip route-static 0.0.0.0 0 192.168.3.2
[R2]ip route-static 0.0.0.0 0 192.168.4.2
让下面那条路作为备份
能看见这个缺省有两条路,一个192.168.4.2,和34.1.1.2,我们把下面那个优先级改大,就达到了备份的效果
[R2]ip route-static 0.0.0.0 0 34.1.1.2 preference 80
当我们把上面那个路断了后,下面这个路径就会从备用(不常用)里面进入使用状态