I've set up OpenVPN on OpenVZ VPS, pushig all traffic trough it - connection is established succesfully, though I cannot resolve any domain.
While connected to VPN:
Code: Select all
root@localhost:~ $ host google.com
Host google.com not found: 5(REFUSED)
Code: Select all
push "dhcp-option DNS 10.8.0.1"
Code: Select all
root@localhost:~ $ host google.com 10.8.0.1
Using domain server:
Name: 10.8.0.1
Address: 10.8.0.1#53
Aliases:
google.com has address 172.217.3.46
google.com has IPv6 address 2607:f8b0:4004:80e::200e
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
Server:
Code: Select all
root@server:/etc/openvpn # iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A FORWARD -i venet0 -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i tun0 -o venet0 -j ACCEPT
root@server:/etc/openvpn # 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:65536 Metric:1
RX packets:4164 errors:0 dropped:0 overruns:0 frame:0
TX packets:4164 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:456465 (445.7 KiB) TX bytes:456465 (445.7 KiB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:880 errors:0 dropped:0 overruns:0 frame:0
TX packets:876 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:53253 (52.0 KiB) TX bytes:53411 (52.1 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.2 P-t-P:127.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.255
inet6 addr: 2602:ffc5:40::1:b52b/128 Scope:Global
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:106498 errors:0 dropped:0 overruns:0 frame:0
TX packets:42520 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:106434333 (101.5 MiB) TX bytes:7636902 (7.2 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:103.11.65.111 P-t-P:103.11.65.111 Bcast:103.11.65.111 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
Code: Select all
root@localhost:~ $ iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -p udp -m udp --sport 53 --dport 1024:65535 -j ACCEPT
root@localhost:~ $ ifconfig
enp1s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 4c:cc:6a:8b:6f:31 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 282874 bytes 452198674 (431.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 282874 bytes 452198674 (431.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.0.6 netmask 255.255.255.255 destination 10.8.0.5
inet6 fe80::2fcb:41de:b78b:ec6e prefixlen 64 scopeid 0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 87 bytes 5156 (5.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 169 bytes 9440 (9.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1280
inet 192.168.1.135 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a20f:2333:3e16:4d30 prefixlen 64 scopeid 0x20<link>
ether e4:a7:a0:b5:5a:b8 txqueuelen 1000 (Ethernet)
RX packets 2094861 bytes 2447357540 (2.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 971963 bytes 132338513 (126.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Thanks in advance.