Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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   -
share|improve this question
    
Please post your routing table. –  MariusMatutiae Jan 11 at 19:28
    
@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 Jan 11 at 20:02

2 Answers 2

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.

share|improve this answer
    
: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 Jan 11 at 20:51
    
: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 Jan 11 at 20:53

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"

share|improve this answer
    
: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 Jan 12 at 9:29
    
: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 Jan 12 at 9:45
    
:I will try it the next days and I will tell you.If you can answer me to the above questions..Thanks! –  George Jan 12 at 12:23
    
: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 Jan 14 at 13:57
    
restart the router. it will reset iptables –  aseaudi Jan 14 at 16:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.