Linux Settings Policy Routing

Source: Internet
Author: User

Add route table
Find
To modify/etc/iproute2/rt_tables, add content:

252 Tel #电信路由表
251 CNC #网通路由表


2) vi/etc/iproute.sh
#!/bin/sh
IP Route Flush Table Tel
IP route add default via 61.7.69.65 (IP gateway) dev eth0 src 61.7.69.105 (IP address) Table Tel
IP rule Add from 61.7.69.105 (IP address) Table Tel

IP route flush Table CNC
IP route add default via 21.6.167.1 dev eth1 src 21.6.167.51 (IP address) Table CNC
IP rule Add from 21.6.167.51 (IP address) Table CNC

Note: In parentheses is just a hint, the actual operation of the time remember to remove.

3 vi/etc/wtiproute.sh
#把附件路由表里的内容复制进来, but be sure to remember that the gateway behind the GW must be rewritten as a gateway to your network environment.

4) chmod 775/etc/iproute.sh
5) chmod 775/etc/wtiproute.sh

6)/etc/iproute.sh
V
7)/etc/wtiproute.sh

8)) Modify the vi/etc/sysctl.conf file,
Put
#net. ipv4.conf.default.rp_filter=1
#net. ipv4.conf.all.rp_filter=1

Switch
Net.ipv4.conf.default.rp_filter=0
Net.ipv4.conf.all.rp_filter=0

Note: If the previous # to remember to remove, if no previous #, directly modify, save can


9) vi/etc/rc.local
/etc/iproute.sh
/etc/wtiproute.sh


10) Verification
Route
or routing
Traceroute 210.52.223.1

Linux Settings Policy Routing

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.