Use linux to implement cisco's route-map policy routing function

Source: Internet
Author: User
Use linux to implement the route function of cisco's route-map policy (the two egress ports are 10.5.39.111 and 10.5.39.222 respectively). The linux ip address is 10.5.39.54/24 ----- (10.5.39.5 layer-3 switch 10.5.51.5) ----- the two users' ip addresses are 10.5.51.11 and 10.5.51.222, respectively... use linux to implement the route function of cisco's route-map policy (the two ports are 10.5.39.111 and 10.5.39.222 respectively). The linux ip address is 10.5.39.54/24 -----
(10.5.39.5 layer-3 switch 10.5.51.5) ----- the gateways of two users whose ip addresses are 10.5.51.11 and 10.5.51.222 are set as the default gateways of layer-3 switches 10.5.39.54 in linux, that is, the ip address with the source address 10.5.51.11 follows the 10.5.39.111 gateway, and the source address is 10.5.51.22.
The ip address follows the 10.5.39.222 gateway and performs the following operations on the linux machine: www.2cto.com 1: route entry to 10.5.51.0: route add-net 10.5.51.0 netmask route 255.255.0 gw 10.5.39.5. forward: net. ipv4.ip _ forward = 1 www.2cto.com 2: Create two route tables: echo 200 T1>/etc/iproute2/rt_tablesecho 210 T2>/etc/iproute2/rt_tables: ip route add default via 10.5.39.111 dev eth0 table T1ip route add default via 10.5.39.222 dev eth0 table T2 add source address-based policy route ip address rule add f Rom 10.5.51.11/32 table T1 ip rule add from 10.5.51.22/32 table T2 view the route table has two T1 and T2 [root @ localhost ~] # Ip route list table alldefault via 10.5.39.111 dev eth0 table T1 default via 10.5.39.222 dev eth0 table T2 View policy route: www.2cto.com [root @ localhost ~] # Ip rule list0: from all lookup local 32759: from 10.5.51.22 lookup T2 32760: from 10.5.51.11 lookup T1 3: verify tracert on 10.5.51.11 and 10.5.51.22, respectively, we can see that there are different lines. 4. when an extended application creates a table using ip rule add, the following parameters can be specified: type (default), from PREFIX,
To PREFIX, iif NAME, tos or dsfield TOS, fwmark MARK, priority PREFERENCE, table TABLEID,
Realms FROM/TO, nat ADDRESS.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.