VPN IP tunneling Application Policy Routing implementation to streaming

Source: Internet
Author: User
Tags iptables

Recently has been tossing this aspect of things, there is no way, there is demand; So these posts are the real case; all the tests passed; it was the same as before; cost savings, unlimited savings ah;

This time on the basis of the last demand building; Here is a demonstration of the fine shearing;

Demand is a machine in China (in fact, more than one) 2 network cards: eth0 (CNC) eth1 (Telecom Tel) There is also a tunnel (IP tunnel) See my friend in front of me know that this tunnel is connected with a machine overseas;

Topology See below:

To achieve the goal: the destination is Netcom's words from the Netcom network card out, the destination is overseas to go to the tunnel; other words from the telecommunications network card out;

Route matching order: Netcom routing (CNC) >>>>> overseas Routing (IPIP) >>>> other routes < default route > (tel)

IP distribution (the old rules, the back two I was hiding, forgive me)

SERVERA:ETH0:58.247.A.A gw:58.247.a.a (netcom link)

eth1:180.153.b.b gw:180.153.b.b (Telecom link)

ethn:10.0.0.1 (IP tunnel)

SERVERB:ETH0:60.251.C.C gw:60.251.c.c (Overseas link)

ethn:10.0.0.2 (IP tunnel)

Here's how it starts:

Server A:

This machine you will find that there are two default routes;

Route-n view can be

Install the PPTPD service, realize normal dialing;

Install pptpd
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables-t nat-a postrouting-s 172.16.0.0/16-o eth Yum 0-j Masquerade
iptables-t nat-a postrouting-s 172.16.0.0/16-o eth1-j Masquerade

Add routing Table

Vim/etc/iproute2/rt_tables,
CNC
IPIP,
tel

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.