OpenVZ Forum


Home » General » Support » openvpn inside openvz
openvpn inside openvz [message #35146] Thu, 05 March 2009 06:14
pichetw is currently offline  pichetw
Messages: 1
Registered: March 2009
Junior Member
I've installed OpenVPN on my visual host. Clients can connect to the server but can not access to the internet. I try to use NAT script but it does not work. Here is my code.

iptables -A FORWARD -s 192.168.10.0/255.255.255.0 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.10.0/255.255.255.0 -o venet0 -j MASQUERADE

and this is my ifconfig

# ifconfig
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:16436 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1680 (1.6 KiB) TX bytes:1680 (1.6 KiB)

tap0 Link encap:Ethernet HWaddr 82:09:D4:D8:9C:78
inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::8009:d4ff:fed8:9c78/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:461 errors:0 dropped:0 overruns:0 frame:0
TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:67125 (65.5 KiB) TX bytes:15284 (14.9 KiB)

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.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:13026 errors:0 dropped:0 overruns:0 frame:0
TX packets:8353 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1352033 (1.2 MiB) TX bytes:1028555 (1004.4 KiB)

venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:122.155.XX.XX P-t-P:122.155.XX.XX Bcast:122.155.XX.XX Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

Client connects through tap0 and I want to have them connected to the internet via venet0 (or venet0:0??)

any ideas?
Previous Topic: Dell OMSA
Next Topic: How to upgrade OPENVZ
Goto Forum:
  


Current Time: Fri Nov 15 21:06:47 GMT 2024

Total time taken to generate the page: 0.04428 seconds