1.静态路由
R1:ip route 22.1.1.0 255.255.255.0 12.1.1.2
2.静态汇总路由
R1:ip route 22.1.0.0 255.255.0.0 12.1.1.2
3.默认静态路由
R1:ip route 0.0.0.0 0.0.0.0 12.1.1.2
4.选择静态路由
R1:
ip route 33.1.1.0 255.255.255.0 12.1.1.2
ip route 33.1.1.1 255.255.255.255 13.1.1.3
5.浮动静态路由
R1:ip route 33.1.1.0 255.255.255.0 13.1.1.3 10
enable
conf t
no ip do lo
enable pass cisco
line con 0
logg sync
exec-t 0 0
line vty 0 4
pass cisco
logg sync
exit
host
1.静态路由
-------------------------------------------------------------------------
-------------------------------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
no shut
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
no shut
exit
R3:
int f0/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
no shut
exit
-------------------------------------------------------------------
R1:
ip route 22.1.1.0 255.255.255.0 12.1.1.2
ip route 23.1.1.0 255.255.255.0 12.1.1.2
ip route 33.1.1.0 255.255.255.0 12.1.1.2
R2:
ip route 11.1.1.0 255.255.255.0 12.1.1.1
ip route 33.1.1.0 255.255.255.0 23.1.1.3
R3:
ip route 11.1.1.0 255.255.255.0 23.1.1.2
ip route 22.1.1.0 255.255.255.0 23.1.1.2
ip route 12.1.1.0 255.255.255.0 23.1.1.2
2.静态汇总路由
-----------------------------------------------------
R2:
int l1
ip add 22.1.0.1 255.255.255.0
no shut
exit
int l2
ip add 22.1.2.1 255.255.255.0
no shut
exit
int l3
ip add 22.1.3.1 255.255.255.0
no shut
exit
R1:
ip route 22.1.0.0 255.255.0.0 12.1.1.2
R3:
ip route 22.1.0.0 255.255.0.0 23.1.1.2
3.默认静态路由
----------------------------------------------------
R1:
no ip route 22.1.0.0 255.255.0.0 12.1.1.2
ip route 0.0.0.0 0.0.0.0 12.1.1.2
R3:
no ip route 22.1.0.0 255.255.0.0 23.1.1.2
ip route 0.0.0.0 0.0.0.0 23.1.1.2
4.选择静态路由
----------------------------------------------------------------------
-----------------------------------------------------------------------
R1:
int f0/0
ip add 13.1.1.1 255.255.255.0
no shut
exit
int f1/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
R3:
int f0/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
int f1/0
ip add 13.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
ip add 33.1.1.2 255.255.255.0 secondary
ip add 33.1.1.3 255.255.255.0 secondary
ip add 33.1.1.4 255.255.255.0 secondary
exit
----------------------------------------------------
R1:
ip route 33.1.1.0 255.255.255.0 12.1.1.2
ip route 33.1.1.1 255.255.255.255 13.1.1.3
R2:
ip route 33.1.1.0 255.255.255.0 23.1.1.3
R3:
ip route 12.1.1.0 255.255.255.0 23.1.1.2
R1:
end
show ip route
trace 33.1.1.1
trace 33.1.1.2
5.浮动静态路由
-----------------------------------------------------
R1:
ip route 33.1.1.0 255.255.255.0 13.1.1.3 10
end
show ip route
conf t
int f1/0
shut
exit
end
show ip route
conf t