LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-26-2011, 07:00 PM   #1
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Simple question about OpenVPN and routing


I have a killer headache, and searched on google for a bit but could not come up with a firm answer about this. I configured OpenVPN on my linksys wrt350n router, and I can connect to my VPN no problem, but I can not access the internet without checking "Use this connection only for resources on its network" in NetworkManager.

I would post the details of route and route -N but I am currently at work. I know that when that option is checked, it is not tunneling the actual internet connection my browser is using through the VPN tunnel. So my question is this: What would be a proper routing configuration? The gateway address is 192.168.2.1 and the IP is being dynamically set. I am using Fedora 13 64 bit, the latest version of networkmanager, and I have dd-wrt v24 mega installed on my router. I understand this is a simple question, but I had a hard enough time getting everything up and running...

Edit: I'm posting this thread because I am asking for information about routing in general and the VPN configuration. I don't know how else to word what I am trying to say....

Last edited by corp769; 01-26-2011 at 07:06 PM.
 
Old 01-27-2011, 09:19 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Original Poster
Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Ok, here are the details as follows...

Normally connected via wireless, no VPN connection:

Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     2      0        0 wlan0
default         mrtrv101a       0.0.0.0         UG    0      0        0 wlan0
This is with the VPN connection:

Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
mrtrv101a       *               255.255.255.255 UH    0      0        0 wlan0
255.255.255.0   *               255.255.255.255 UH    0      0        0 tun0
192.168.2.0     *               255.255.255.0   U     2      0        0 wlan0
default         *               0.0.0.0         U     0      0        0 tun0
And this is with the "Use this connection only for resources on its network" option checked:

Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
mrtrv101a       *               255.255.255.255 UH    0      0        0 wlan0
255.255.255.0   *               255.255.255.255 UH    0      0        0 tun0
192.168.2.0     *               255.255.255.0   U     2      0        0 wlan0
default         mrtrv101a       0.0.0.0         UG    0      0        0 wlan0
What I am confused about is what I need to insert into the routing dialog. I'm a bit newer to NetworkManager as far as working out flaws, so bare with me. To my knowledge, I just have to change the interface for the following section

Code:
default         mrtrv101a       0.0.0.0         UG    0      0        0 wlan0
to

Code:
default         mrtrv101a       0.0.0.0         UG    0      0        0 tun0
but NetworkManager gives me no option. Help? Thanks guys.

Last edited by corp769; 01-27-2011 at 09:20 AM.
 
Old 01-31-2011, 12:19 PM   #3
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Original Poster
Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Bump, a bump bump bump, bumpity-da-bump. *rapping*
 
Old 01-31-2011, 05:27 PM   #4
devwatchdog
Member
 
Registered: Jan 2010
Posts: 202

Rep: Reputation: 47
You seem to assume that once the VPN session is established, that all traffic will be routed through the tunnel. This is incorrect.

You didn't mention the version of OpenVPN you're using, but I'd imagine that this should work:

http://openvpn.net/index.php/open-so....html#redirect

If not, you'll be looking for specific instructions regarding the version of OpenVPN you are using.

Note the caveats at the bottom of those instructions.
 
Old 02-01-2011, 02:12 PM   #5
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Original Poster
Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Nevermind, I'm just going to mark this as solved and try every option I am going to think of.
 
Old 02-01-2011, 02:18 PM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
Destination Gateway Genmask Flags Metric Ref Use Iface
mrtrv101a * 255.255.255.255 UH 0 0 0 wlan0
255.255.255.0 * 255.255.255.255 UH 0 0 0 tun0
192.168.2.0 * 255.255.255.0 U 2 0 0 wlan0
default mrtrv101a 0.0.0.0 UG 0 0 0 wlan0
Where did you set the 255.255.255.0 address? That is a reserved range...
 
Old 02-02-2011, 11:22 AM   #7
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Original Poster
Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Quote:
Originally Posted by szboardstretcher View Post
Where did you set the 255.255.255.0 address? That is a reserved range...
That's the thing man, I didn't set this myself. NetworkManager did....
 
Old 02-03-2011, 01:54 PM   #8
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Well,.. that means that DHCP is sending the information. Is your DHCP server set up correctly? Offering the correct netmask/gateway? It looks as if your Netmask of 255.255.255.0 is ending up as your Gateway,.. this might be a typo in your settings?
 
Old 02-04-2011, 04:27 PM   #9
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Original Poster
Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
That's a negative on that one... The gateway is set up correctly, and the DHCP server is good to go. The netmask seems fine when I don't use the VPN. What I do know is that when I am connected without it, everything works perfectly, and the gateway/netmask are correct. Maybe a flaw with network manager?
 
Old 02-07-2011, 10:19 AM   #10
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
What does your openVPN config look like?
 
Old 02-13-2011, 03:35 PM   #11
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Original Poster
Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
I will post it tonight, I'm off of leave now and back home, so now I have time to work on it.
 
Old 02-15-2011, 11:09 AM   #12
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Original Poster
Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Code:
mode server
proto udp
port 1194
dev tap0
server-bridge 192.168.2.2 255.255.255.0 192.168.2.200 192.168.2.249
keepalive 10 120
daemon
verb 5
client-to-client
dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem
management localhost 5001
Ok, that is the config for OpenVPN on my router.
 
Old 07-02-2011, 08:45 PM   #13
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Original Poster
Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Bumpin' for the best!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] OpenVPN Routing question master_lain Linux - Networking 2 09-16-2010 09:35 PM
Error When converting Routing OpenVPN to bridge mode openvpn danmartinj Linux - Software 0 11-06-2009 09:23 AM
openvpn routing question watcher69b Linux - Server 3 01-18-2009 11:25 AM
Simple routing question zang Linux - Networking 4 04-28-2008 05:55 PM
another simple routing question crm Linux - Networking 3 03-29-2005 01:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration