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