6

I have an ubuntu machine on which I am running an openvpn server. From a windows machine on a different network when I try to connect to the ubuntu machine it says connected. I can even ping the local ip of the ubuntu machine. But I do not get a public ip address. That is the public ip address of the computer(windows) remains the same and does not change(checked on cmyip). Why is this happening and how should I resolve this issue?

Client config:

    client

    proto udp

    dev tun

    ca ca.crt

    dh dh2048.pem

    cert client3.crt

    key client3.key

    remote publicip 1194

    cipher DES-CBC

    verb 2

    mute 20

    keepalive 10 120

    comp-lzo

    persist-key

    persist-tun

    float

    resolv-retry infinite

    nobind

Server config:

port 1194
proto udp
dev tun0
ca keys/test/ca.crt
cert keys/test/check.crt
key keys/test/check.key
dh keys/test/dh2048.pem
server 10.180.240.0 255.255.240.0
crl-verify keys/test/crl.pem
cipher DES-CBC
user nobody
group nogroup
status servers/VPn1/logs/openvpn-status.log
log-append servers/VPn1/logs/openvpn.log
verb 2
mute 20
max-clients 100
local 192.168.1.101
keepalive 10 120
client-config-dir /etc/openvpn/servers/VPn1/ccd
client-to-client
duplicate-cn
comp-lzo
persist-key
persist-tun
ccd-exclusive
route 10.22.1.0 255.255.255.0
route 10.22.2.0 255.255.255.0
route 10.22.3.0 255.255.255.0
push "route 10.180.0.0 255.255.252.0"
push "route 10.22.1.0 255.255.255.0"
push "route 10.22.2.0 255.255.255.0"
push "route 10.22.3.0 255.255.255.0"
push "dhcp-option DNS 10.180.3.12"

ipconfig /all

Tunnel adapter 6TO4 Adapter:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft 6to4 Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #4
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #5
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
6
  • 1
    What are your config files from server and client (non-comment lines only)?
    – ott--
    Jan 22, 2013 at 9:44
  • have made the changes now
    – Sab
    Jan 22, 2013 at 10:37
  • Can you show the output of ipconfig /all on windows stripped to the data for the TAP?
    – ott--
    Jan 22, 2013 at 10:48
  • edited the question
    – Sab
    Jan 22, 2013 at 11:55
  • Mine looks different: TAP-Win32 Adapter V9
    – ott--
    Jan 22, 2013 at 12:07

6 Answers 6

6

If you want to use OpenVPN server as gateway, you need to push default route to your clients.

server config:

push "redirect-gateway def1"

http://openvpn.net/index.php/open-source/documentation/howto.html#redirect

2
> Press ENTER for default [443]:

Should client traffic be routed by default through the VPN?
> Press ENTER for default [no]:

Should client DNS traffic be routed by default through the VPN?
> Press ENTER for default [no]:

Use local authentication via internal DB?
> Press ENTER for default [yes]:

Private subnets detected: ['172.31.0.0/16']

Should private subnets be accessible to clients by default?

> Press ENTER for EC2 default [yes]:

While initialting the you see this questions being asked.

The default value of the following question will ne "no" you have to change it to "yes" to change the client IP to VPN Server IP.

Should client DNS traffic be routed by default through the VPN?
> Press ENTER for default [no]: yes
1

Your expectation is incorrect. There is nothing to tell the machine to use the VPN as its gateway to the Internet, so no reason its public IP address, as seen from the Internet, should change.

0

Here is the proper Windows 7 & dd-wrt set-up

Server Config:

server 172.20.20.0 255.255.255.248
push "dhcp-option DNS 192.168.0.1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
dev tun0
proto tcp
port 443
keepalive 15 30

daemon
verb 0
mute 5
comp-lzo
duplicate-cn
tls-server

dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem
tls-auth /tmp/openvpn/ta.key 0

management localhost 14

Client Config:

client
dev tun0
proto tcp
port 443
remote xxx.xxx.xxx.xxx 443
remote xxx.xxx.xxx.xxx 443
nobind
persist-key
persist-tun
ns-cert-type server
comp-lzo
verb 3
ca ca.crt
cert client1.crt
key client1.key
tls-auth ta.key 1

DD-wrt Firewall:

iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT
iptables -I FORWARD 1 --source 172.20.20.0/29 -j ACCEPT
1
  • Welcome to Server Fault. Can you edit your answer to provide a brief explanation of how your answer addresses the OP's question for those who may not immediately recognize it from your posted config? Jun 6, 2015 at 2:45
0

Yes I can explain how it answers the original post, 1. I have a working OpenVPN on my DD-Wrt home router in which all traffic is routed thru the vpn. 2. As you will notice in my config I left the dev as dev tun0 andriod and linux don't like tap. The original poster thinks his ip will be changed by magic when he is still connecting to the home vpn. Use my proper set up, reboot the router then connect the client machine. Do an Ip check, then go to an out side hot spot and again connect the client machine to the vpn thru the hot spot bingo your ip has now changed to your home public IP. Magic.

If you are in your living room connecting to your vpn of course your ip shows your public home ip, away and on public wifi connected to your vpn again it will still show your home public ip the vpn doesn't obscure your real ip. You will need to use a proxy for that task. The vpn assigns ip's the same way any regular router does, but with a vpn your data is encrypted.

or use an out side vpn.

There is so much dis information on the internet, it's hard to find accurate info and answers.

0

Some years later I had similar problems. The reason was setting deprecated options in the client config like comp-lzo. Removing them solved it for me. You can find a list of deprecated options in their wiki.

https://community.openvpn.net/openvpn/wiki/DeprecatedOptions

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .