Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Policy routing

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

In the example analysis of policy routing, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.

Policy-based routing allows the application of a policy to control how packets should go rather than routing based on routing tables. IP routing is based on destination, while PBR policy routing allows source-based routing, that is, where it comes from and where it should go, thus taking a special path as needed. There are also packet-based applications for policy routing.

Implementing policy-based routing in a network has the following advantages:

1. Source-based supplier selection: through policy routing, data flows from different user groups are selected through different Internet connections.

2. Quality of service: by setting the priority or TOS value in the IP packet header on the network edge router, and using the queuing mechanism to divide different priorities for the data flow in the network core or backbone, to provide different levels of QoS for different data streams.

3. Load balancing: network administrators can distribute data streams on multiple paths through policy routing.

4. Network management is more flexible.

Let's look at an example:

R1 is configured as follows:

Interface Loopback0 / / Analog Subnet 1: 192.168.1.0 Universe 24

Ip address 192.168.1.1 255.255.255.0 / / the first host in the simulated subnet

Ip address 192.168.1.2 255.255.255.0 secondary / / the second host in the simulated subnet

!

Interface Loopback2 / / Analog Subnet 2: 192.168.2.0 Universe 24

Ip address 192.168.2.1 255.255.255.0

Ip address 192.168.2.2 255.255.255.0 secondary

!

Interface FastEthernet0/0

Ip address 12.0.0.1 255.255.255.0

Duplex half

!

……

!

Router rip / / configure network connectivity through the RIP protocol

Version 2

Network 192.168.1.0

Network 192.168.2.0

Network 12.0.0.0

No auto-summary

R3 is configured as follows:

Interface Loopback0 / / simulates a connection target

Description to internet

Ip address 100.100.100.100 255.255.255.0

!

Interface Serial1/0 / / Analog ISP1 access port

Ip address 123.0.0.3 255.255.255.0

Serial restart-delay 0

!

……

Interface Serial1/1 / / Analog ISP2 access port

Ip address 223.0.0.3 255.255.255.0

Serial restart-delay 0

!

Router rip

Version 2

Network 100.100.100.0

Network 123.0.0.0

Network 223.0.0.0

No auto-summary

R2 is configured as follows:

Interface FastEthernet0/0

Ip address 12.0.0.2 255.255.255.0

Ip policy route-map isp-test / / enable policy routing isp-test on the interface for traffic control

!

……

Interface Serial1/0

Ip address 123.0.0.1 255.255.255.0

Serial restart-delay 0

!

Interface Serial1/1

Ip address 223.0.0.1 255.255.255.0

Serial restart-delay 0

……

Router rip

Version 2

Network 12.0.0.0

Network 123.0.0.0

Network 223.0.0.0

No auto-summary

……

Logging alarm informational

Access-list 101 permit ip 192.168.1.0 0.0.255 host 100.100.100.100 / / access control list 101, which is used to filter the original address and allow 192.168.1.0 traffic to pass through * /

Access-list 101permit ip any any (backup)

Access-list 102 permit ip 192.168.2.0 0.0.255 host 100.100.100.100 / / access control list 102, which is used to filter the original address and allow 192.168.2.0 traffic to pass through * /

Access-list 102 permit ip any any (backup)

!

Route-map isp-test permit 10 / / defines route-map, named isp-test, with sequence 10

Match ip address 101s / / check the source address to match acl 101s

Set ip default next-hop 123.0.0.3 / / specify next hop address (or set interface s1ap0)

!

Route-map isp-test permit 20 / / defines the second statement of isp-test, sequence number is 20

Match ip address 102 / / check source underground, match acl102

Set ip default next-hop 223.0.0.3 (or set interface s1Acer 1)

!

Route-map isp-test permit 30 / / defines the third statement of isp-test with sequence number 30

Set default interface Null0 / / discard packets that do not match the specified standard

……

End

Finally, the test is conducted:

R2#sh ip policy / / display the strategy of the application

Interface Route map

Fa0/0 isp-test

R2#sh route-map isp-test / / displays the configured route map

Route-map isp-test, permit, sequence 10

Match clauses:

Ip address (access-lists): 101

Set clauses:

Ip default next-hop 123.0.0.3

Policy routing matches: 0 packets, 0 bytes

Route-map isp-test, permit, sequence 20

Match clauses:

Ip address (access-lists): 102

Set clauses:

Ip default next-hop 223.0.0.3

Policy routing matches: 0 packets, 0 bytes

Route-map isp-test, permit, sequence 30

Match clauses:

Set clauses:

Default interface Null0

Policy routing matches: 0 packets, 0 bytes

=

R1#traceroute / / Route tracking

Protocol [ip]:

Target IP address: 100.100.100.100 / / destination

Source address: 192.168.1.1 / / the first host whose source address is subnet 1

Numeric display [n]:

Timeout in seconds [3]:

Probe count [3]:

Minimum Time to Live [1]:

Maximum Time to Live [30]:

Port Number [33434]:

Loose, Strict, Record, Timestamp, Verbose [none]:

Type escape sequence to abort.

Tracing the route to 100.100.100.100

1 12.0.0.2 72 msec 216 msec 276 msec

2 123.0.0.3 288 msec 360 msec * / / ISP1 entrance

R1#traceroute

Protocol [ip]:

Target IP address: 100.100.100.100

Source address: 192.168.2.1 / / the first host whose source address is subnet 2

Numeric display [n]:

Timeout in seconds [3]:

Probe count [3]:

Minimum Time to Live [1]:

Maximum Time to Live [30]:

Port Number [33434]:

Loose, Strict, Record, Timestamp, Verbose [none]:

Type escape sequence to abort.

Tracing the route to 100.100.100.100

1 12.0.0.2 136 msec 40 msec 144 msec

2 223.0.0.3 356 msec * 132 msec / / ISP2 entrance

Through the above experiments, we can see that the traffic of subnet 1 (192.168.1.0) chose the ISP1 link through the previous link of R2-R3, and the traffic of subnet 2 (192.168.2.0) chose the ISP2 link through the next link of R2-R3. Therefore, source-based supplier selection and network load balancing can be achieved through policy routing.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report