vpn is working but ip address not changing

2

2

Is there something we can check for this? It is a response from vpn using dynamic DNS connected but no internet (openwrt router as server).

When I connect to vpn and check my ip from whatismyip it is still the same as before connecting.

I am connecting to a friends wifi and the ip when I check it is the same as when i am connected to vpn.

route -n before vpn (at my home wifi):

    Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U     9      0        0 wlan0
192.168.1.153   127.0.0.1       255.255.255.255 UGH   302    0        0 lo

route -n before vpn (at my friends wifi):

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U     9      0        0 wlan0
192.168.1.2     127.0.0.1       255.255.255.255 UGH   302    0        0 lo
192.168.1.135   127.0.0.1       255.255.255.255 UGH   302    0        0 lo

route -n after connecting to vpn (through my friends wifi):

Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 tap0
79.1.... 192.168.1.254 255.255.255.255 UGH 0 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0
192.168.1.2 127.0.0.1 255.255.255.255 UGH 303 0 0 lo
192.168.1.134 127.0.0.1 255.255.255.255 UGH 303 0 0 lo

I am using a router with openwrt as server (192.168.1.1).

-----UPDATE---------

How to remove this?

Table: NAT
Chain zone_wan_nat (References: 1)
Rule #  Pkts.   Traffic     Target  Prot.   Flags   In  Out     Source  Destination     Options
1   834     57.26 KB    MASQUERADE  all     --  *   *   0.0.0.0/0   0.0.0.0/0   -

George

Posted 2014-01-11T18:22:31.447

Reputation: 167

Please post your routing table. – MariusMatutiae – 2014-01-11T19:28:02.967

@MariusMatutiae:Ok, I updated.Because I had a chat (to the post I have a link in the beginning) we saw that everything works.Traceroute works fine etc..Only ip is not changinh.I must say I am using a hostname (no ip.com) as a gateway to connect to my openvpn – George – 2014-01-11T20:02:24.283

Answers

1

Here, you're only routing traffic destined for 10.10.10.0/24 to the "tap0" interface. "tap0" is a virtual/imaginary interface that linux uses to "fake" a layer-2 connection. So in your particular case, when you send a web request to whatsmyip.com or whatever, that particular traffic is going out your normal ethernet (eth0) interface, which means the service will do a DNS lookup and see your normal, non-tunneled IP address.

If you can, use the VPN connection to SSH or telnet or remote desktop or VNC or whatever to a computer that's on the 10.10.10.x network. Then from THAT machine, do a "whatsmyip" and you should see something different, because (presumably?) that computer will have a different default route to the internet.

ljwobker

Posted 2014-01-11T18:22:31.447

Reputation: 256

:If you can help me because I don't understand everything..I had in my /etc/config/openvpn " option 'server_bridge' '192.168.1.1 255.255.255.0 192.168.1.200 192.168.1.225'" (my network is 192.168.x.x) but it didn't worked(I had no internet access) .So , I changed it to " option 'server_bridge' '10.10.10.1 255.255.255.0 10.10.10.2 10.10.10.10'" and I have internet access. – George – 2014-01-11T20:51:18.577

:Could you please tell me what I need to do?I didn't understand how to do vpn over ssh?I am using openvpn and I have a hostname in noip which I use as a gateway. – George – 2014-01-11T20:53:21.540

1

Try adding the following option in the openvpn config file:

push "redirect-gateway def1"

This will force all your traffic to use the vpn tunnel to the vpn server on your home router.

If you run "traceroute www.google.com" before connecting to the vpn and after connecting to the vpn, you will see that you will take different path, meaning traffic is going through the vpn.

If you want to see your home router public ip address (the no-ip domain name) on whatismyip.com when using the vpn, then you need to NAT your traffic on the router.

You can do this on your router via the command :

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

This command will translate the source IP of your traffic to the public ip of your home router, and thus whatismyip.com should give you your home ip next time.

If your wan interface is not eth0, and is eth1 for example, then you need to change it in the command, i.e. "-o eth1"

aseaudi

Posted 2014-01-11T18:22:31.447

Reputation: 461

:I have already in openvpn file list 'push' 'redirect-gateway def1' . Regarding the iptables command , I should leave 'wlan0' or 'tap0' (tap0 is inside openvpn file as option 'dev' 'tap0'.So,the resume of all this is that my vpn is working regardless of the ip that does not change,right?It doesn't have any vulnerabilities this?Thanks! – George – 2014-01-12T09:29:47.087

:Or do i need to use interface 'wan2' ? because at that interface i have the pppoe settings.Also,please note that i will be missing for a few days ,so my response maybe late. – George – 2014-01-12T09:45:34.303

:I will try it the next days and I will tell you.If you can answer me to the above questions..Thanks! – George – 2014-01-12T12:23:00.077

:Hello,I did iptables -t.. but now I can't connect at all !!to myvpn!And I don't remember what interface I used in th above command (wlan0,tap0..).Is there a way to revert it?(please note that i may have a late response) – George – 2014-01-14T13:57:56.347

restart the router. it will reset iptables – aseaudi – 2014-01-14T16:41:51.900

:Ok,the problem was from the hostname I used ,that;s why it didn;t connect.I did restart the router but the rule didn't delete.I updated my answer to see the rule.How can I delete it?And what interface must I fill?wlan0?pppoe-wan?tap0? – George – 2014-01-16T17:09:11.630

@:I also used list 'push' 'dhcp-option DNS 192.168.1.1' from here http://wiki.openwrt.org/doc/howto/vpn.openvpn ,but still the same IP..I dodn't understand though if I need the above 3 lines (from the link I send you)and instead mydomain.local should I uuse myhostaname in noip?

– George – 2014-01-16T17:23:23.127

:Hello,regarding the IP,I found that unchecking the box "USe only for resources on this connection" results in changhing the IP.But ,I figured (not by doing the above) that the internet access goes down after a few seconds and show "no route to host".I opened a new post here http://superuser.com/questions/703042/openvpn-no-route-to-host-access-only-for-few-seconds .If you want answer this question in order to accept it and thank you for all your help

– George – 2014-01-17T12:25:24.677