tried to setup openvpn server on a VPS with OpenVZ few times without succes until i found an automated script that installed openvpn. I use a VPS on OpenVZ platform with Debian 6. Since i am part of a restricted network i changed the port from 1194 to 443. I succed to connect to the VPN server using udp and tcp but there is no benefit in connecting to VPN server because my ip remains the same, and my ports are not open, which is the sole purpose of this, to get my ports opened since i am on a restricted network.Here are my configs:
server conf:
Code: Select all
root@vps:/etc/openvpn# cat openvpn.conf
port 443
dev tun
proto tcp
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
push "route 10.8.0.0 255.255.255.0"
push "redirect-gateway"
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
group daemon
daemon
Code: Select all
client
remote 188.241.154.65 443
proto tcp
dev tap
resolv-retry infinite
persist-key
persist-tun
comp-lzo
ca ca.crt
cert client1.crt
key client1.key
route-delay 2
route-method exe
redirect-gateway def1
dhcp-option DNS 10.8.0.1
keepalive 5 120
route-metric 1
verb 3
Code: Select all
root@vps:/etc/openvpn# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:60 errors:0 dropped:0 overruns:0 frame:0
TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5100 (4.9 KiB) TX bytes:5100 (4.9 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:0 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:0 (0.0 B) 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
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:41485 errors:0 dropped:0 overruns:0 frame:0
TX packets:33904 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:18555727 (17.6 MiB) TX bytes:5265587 (5.0 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:188.241.154.65 P-t-P:188.241.154.65 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
venet0:1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:188.241.154.66 P-t-P:188.241.154.66 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
Code: Select all
root@vps:/etc/openvpn# iptables-save
# Generated by iptables-save v1.4.8 on Fri Mar 1 04:41:23 2013
*mangle
:PREROUTING ACCEPT [41806:18583907]
:INPUT ACCEPT [41806:18583907]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [34220:5308174]
:POSTROUTING ACCEPT [34220:5308174]
COMMIT
# Completed on Fri Mar 1 04:41:23 2013
# Generated by iptables-save v1.4.8 on Fri Mar 1 04:41:23 2013
*filter
:INPUT ACCEPT [13728:3337016]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [10533:1340221]
-A FORWARD -i tun0 -o venet0:0 -j ACCEPT
-A FORWARD -i tun0 -o venet0 -j ACCEPT
COMMIT
# Completed on Fri Mar 1 04:41:23 2013
# Generated by iptables-save v1.4.8 on Fri Mar 1 04:41:23 2013
*nat
:PREROUTING ACCEPT [726:62323]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [1896:123246]
-A POSTROUTING -o venet0 -j SNAT --to-source 188.241.154.65
COMMIT
# Completed on Fri Mar 1 04:41:23 2013
Code: Select all
root@vps:/etc/openvpn# netstat -na
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1723 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN
tcp 0 0 10.8.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 188.241.154.66:53 0.0.0.0:* LISTEN
tcp 0 0 188.241.154.65:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
tcp 0 784 188.241.154.66:22 223.4.4.11:38665 ESTABLISHED
tcp 0 284 188.241.154.65:22 95.76.222.66:2961 ESTABLISHED
tcp 0 0 188.241.154.65:22 95.76.222.66:3149 ESTABLISHED
udp 0 0 10.8.0.1:53 0.0.0.0:*
udp 0 0 188.241.154.66:53 0.0.0.0:*
udp 0 0 188.241.154.65:53 0.0.0.0:*
udp 0 0 127.0.0.1:53 0.0.0.0:*
udp 0 0 188.241.154.65:137 0.0.0.0:*
udp 0 0 188.241.154.65:137 0.0.0.0:*
udp 0 0 188.241.154.66:137 0.0.0.0:*
udp 0 0 188.241.154.66:137 0.0.0.0:*
udp 0 0 0.0.0.0:137 0.0.0.0:*
udp 0 0 188.241.154.65:138 0.0.0.0:*
udp 0 0 188.241.154.65:138 0.0.0.0:*
udp 0 0 188.241.154.66:138 0.0.0.0:*
udp 0 0 188.241.154.66:138 0.0.0.0:*
udp 0 0 0.0.0.0:138 0.0.0.0:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 1689715349 /var/run/sendmail/mta/smcontrol
unix 2 [ ACC ] STREAM LISTENING 1689713280 /var/run/saslauthd/mux
unix 8 [ ] DGRAM 1689713356 /dev/log
unix 3 [ ] STREAM CONNECTED 2024717623
unix 3 [ ] STREAM CONNECTED 2024717622
unix 2 [ ] DGRAM 2008387544
unix 2 [ ] DGRAM 1973859243
unix 2 [ ] DGRAM 1689735495
unix 2 [ ] DGRAM 1689715328
unix 2 [ ] DGRAM 1689714368
unix 2 [ ] DGRAM 1689713509