Hi guys
I want get a multihop VPN by OPENWRT, currently I set it to work for single using strongSwan and xl2tpd and L2TP/IPSec protocol, it's work fine all. Then I wanna throught the package from VPN1(ppp0) to VPN2(ppp1).
anybody have the good ideas?
the interface list was below:
eth0.2 Link encap:Ethernet HWaddr F0:B4:29:71:71:B0
inet addr:192.168.2.151 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::f2b4:29ff:fe71:71b0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:75300 errors:0 dropped:0 overruns:0 frame:0
TX packets:61454 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:28563603 (27.2 MiB) TX bytes:13016694 (12.4 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:159 errors:0 dropped:0 overruns:0 frame:0
TX packets:159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:13604 (13.2 KiB) TX bytes:13604 (13.2 KiB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.20.0.24 P-t-P:1.0.0.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:35984 errors:0 dropped:0 overruns:0 frame:0
TX packets:44892 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:21072150 (20.0 MiB) TX bytes:6357224 (6.0 MiB)
ppp1 Link encap:Point-to-Point Protocol
inet addr:10.20.0.10 P-t-P:1.0.0.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:30 (30.0 B) TX bytes:30 (30.0 B)
and the route table was below:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 1dot1dot1dot1.c 0.0.0.0 UG 0 0 0 ppp0
1.0.0.1 * 255.255.255.255 UH 0 0 0 ppp0
1.0.0.1 * 255.255.255.255 UH 0 0 0 ppp1
108.59.8.41 192.168.2.1 255.255.255.255 UGH 0 0 0 eth0.2
151.236.34.170 192.168.2.1 255.255.255.255 UGH 0 0 0 eth0.2
192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0.2
192.168.2.1 * 255.255.255.255 UH 0 0 0 eth0.2
and the firmwall rule:
iptables -A forwarding_rule -i ppp0 -o br-lan -j ACCEPT
iptables -A forwarding_rule -i br-lan -o ppp0 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o ppp0 -j MASQUERADE