本文共 6356 字,大约阅读时间需要 21 分钟。
rip 1 version 2 network 192.168.20.0 network 192.168.2.0
#ospf 1 area 0.0.0.1 network 192.168.40.240 0.0.0.15 network 192.168.2.0 0.0.0.255 network 192.168.3.0 0.0.0.255 network 192.168.4.0 0.0.0.255 network 192.168.5.0 0.0.0.255 network 192.168.6.0 0.0.0.255 network 192.168.7.0 0.0.0.255 network 192.168.8.0 0.0.0.255 network 192.168.9.0 0.0.0.255 network 172.16.0.0 0.0.0.255 network 192.168.30.0 0.0.0.255 network 172.16.100.0 0.0.0.255#
# ip route-static 0.0.0.0 0.0.0.0 192.168.1.1 preference 10 description TC ip route-static 0.0.0.0 0.0.0.0 192.168.20.1 preference 20 description UC ip route-static 4.4.4.4 255.255.255.255 192.168.40.254 description google dns ip route-static 8.8.8.8 255.255.255.255 192.168.40.254 description google dns ip route-static 64.4.61.215 255.255.255.255 192.168.40.254 ip route-static 74.125.71.94 255.255.255.255 192.168.40.254 ip route-static 192.168.20.0 255.255.255.0 192.168.20.1 description UC ip route-static 192.168.30.112 255.255.255.255 192.168.30.254 ip route-static 203.208.46.146 255.255.255.255 192.168.40.254#
浮动路由
ip route-static 0.0.0.0 0.0.0.0 192.168.1.1 preference 10 description TC ip route-static 0.0.0.0 0.0.0.0 192.168.20.1 preference 20 description UC
案例一
acl number 3000 rule 0 permit ip source 192.168.2.1 0acl number 3001 rule 0 permit ip source 192.168.6.0 0.0.0.255#traffic classifier 2 operator or if-match acl 3000traffic classifier 1 operator and if-match acl 3001#traffic behavior 1 redirect next-hop 192.168.40.254#qos policy 2 classifier 2 behavior 1qos policy 1 classifier 1 behavior 1#interface GigabitEthernet1/0/11 qos apply policy 1 inbound#interface GigabitEthernet1/0/12 qos apply policy 2 inbound
取消策略路由
interface GigabitEthernet1/0/11un qos apply policy inbound#interface GigabitEthernet1/0/12un qos apply policy inboundquitun qos policy 1un traffic behavior 1un traffic classifier 1un acl number 3001
这个案例是基于源的策略路由
案例二
acl number 3010 rule 0 permit ip source any destination 192.168.0.0 0.0.255.255acl number 3020 rule 0 permit ip source 192.168.6.0 0.0.0.255traffic classifier classifier1 operator or if-match acl 3010traffic classifier classifier2 operator or if-match acl 3020traffic behavior behavior1 redirect next-hop 192.168.1.1traffic behavior behavior2 redirect next-hop 192.168.40.254qos policy policy1 classifier classifier1 behavior behavior1 classifier classifier2 behavior behavior2interface GigabitEthernet1/0/11 qos apply policy policy1 inbound
案例二是一个基于目的的测略路由
[H3C]display ip routing-table Routing Table: public netDestination/Mask Protocol Pre Cost Nexthop Interface0.0.0.0/0 STATIC 60 0 192.168.3.1 Vlan-interface1127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0192.168.3.0/24 DIRECT 0 0 192.168.3.12 Vlan-interface1192.168.3.12/32 DIRECT 0 0 127.0.0.1 InLoopBack0192.168.5.0/24 STATIC 60 0 192.168.3.252 Vlan-interface1192.168.6.0/24 DIRECT 0 0 192.168.6.254 Vlan-interface6192.168.6.254/32 DIRECT 0 0 127.0.0.1 InLoopBack0192.168.7.0/24 DIRECT 0 0 192.168.7.254 Vlan-interface7192.168.7.254/32 DIRECT 0 0 127.0.0.1 InLoopBack0192.168.8.0/24 DIRECT 0 0 192.168.8.254 Vlan-interface8192.168.8.254/32 DIRECT 0 0 127.0.0.1 InLoopBack0192.168.9.0/24 DIRECT 0 0 192.168.9.254 Vlan-interface9192.168.9.254/32 DIRECT 0 0 127.0.0.1 InLoopBack0
[H3C-rip-1]display ip routing-tableRouting Tables: Public Destinations : 36 Routes : 36Destination/Mask Proto Pre Cost NextHop Interface0.0.0.0/0 Static 60 0 192.168.1.1 Vlan11.1.1.1/32 Direct 0 0 127.0.0.1 InLoop04.4.4.4/32 Static 60 0 192.168.40.254 Vlan408.8.8.8/32 Static 60 0 192.168.40.254 Vlan4064.4.61.215/32 Static 60 0 192.168.40.254 Vlan4074.125.71.94/32 Static 60 0 192.168.40.254 Vlan40127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0172.16.0.0/24 OSPF 10 2 192.168.40.254 Vlan40192.168.1.0/24 Direct 0 0 192.168.1.254 Vlan1192.168.1.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.2.0/24 Direct 0 0 192.168.2.254 Vlan2192.168.2.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.3.0/24 Direct 0 0 192.168.3.254 Vlan3192.168.3.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.4.0/24 Direct 0 0 192.168.4.254 Vlan4192.168.4.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.5.0/24 Direct 0 0 192.168.5.254 Vlan5192.168.5.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.6.0/24 Direct 0 0 192.168.6.254 Vlan6192.168.6.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.7.0/24 Direct 0 0 192.168.7.254 Vlan7192.168.7.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.8.0/24 Direct 0 0 192.168.8.254 Vlan8192.168.8.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.9.0/24 Direct 0 0 192.168.9.254 Vlan9192.168.9.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.20.0/24 Direct 0 0 192.168.20.254 Vlan20192.168.20.254/32 Direct 0 0 127.0.0.1 InLoop0192.168.30.0/24 Direct 0 0 192.168.30.1 Vlan30192.168.30.1/32 Direct 0 0 127.0.0.1 InLoop0192.168.30.112/32 Static 60 0 192.168.30.254 Vlan30192.168.40.240/28 Direct 0 0 192.168.40.253 Vlan40192.168.40.253/32 Direct 0 0 127.0.0.1 InLoop0192.168.50.128/25 OSPF 10 2 192.168.40.254 Vlan40203.208.46.146/32 Static 60 0 192.168.40.254 Vlan40