tap0 Link encap:Ethernet HWaddr ca:8d:d5:10:55:72
inet addr:10.9.0.1 Bcast:10.9.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:116 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:12437 (12.1 KiB) TX bytes:0 (0.0 B)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.2 P-t-P:127.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:85163 errors:0 dropped:0 overruns:0 frame:0
TX packets:104638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15742605 (15.0 MiB) TX bytes:79662056 (75.9 MiB)
venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:212.212.212.212 P-t-P:212.212.212.212 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
You’ll need to do 1 thing more to fix the routing. That is to route the traffic from tun0 to the interface that provides internet (venet0:0 by default).
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source your_vps_ip
iptables-save
Since we can’t use the MASQUERADE command, we need to use SNAT. Also only full interfaces are supported (So venet0:0 isn’t compatible with the -o option). That’s why I cover this on a static IP based configuration. This will route all network traffic on 10.8.0.0 to the internet-supplying interface.
net.ipv4.ip_forward = 1
уже был включен.
Пользователь решил продолжить мысль 11 Апреля 2012, 22:05:28:
Мои настройки сети
Подключение по локальной сети - Ethernet адаптер:
DNS-суффикс этого подключения . . : dsl.lan
IP-адрес . . . . . . . . . . . . : 192.168.1.3
Маска подсети . . . . . . . . . . : 255.255.255.0
Основной шлюз . . . . . . . . . . : 192.168.1.1
vpn_lan - Ethernet адаптер:
DNS-суффикс этого подключения . . :
IP-адрес . . . . . . . . . . . . : 10.9.0.4
Маска подсети . . . . . . . . . . : 255.255.255.0
Основной шлюз . . . . . . . . . . : 10.9.0.1