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-15-2011, 04:30 AM   #1
shadyabhi
LQ Newbie
 
Registered: Sep 2008
Posts: 20

Rep: Reputation: 0
iptables + openvpn + eth0 and tun0


Basically, I want to use both connections for internet simultaneously. Its like, if I want to download without using openvpn, I use

Code:
curl --interface eth0 www.google.com
And if I want to do it with openvpn, I do
Code:
curl --interface tun0 www.google.com
Route table before connecting to VPN;
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.100.98.0     *               255.255.255.0   U     1      0        0 eth0
default         10.100.98.4     0.0.0.0         UG    0      0        0 eth0
With VPN using this configuration http://dl.dropbox.com/u/7728421/torvpn-shadyabhi.ovpn

Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.10.0.1       10.10.54.230    255.255.255.255 UGH   0      0        0 tun0
10.10.54.230    *               255.255.255.255 UH    0      0        0 tun0
free-vpn.torvpn 10.100.98.4     255.255.255.255 UGH   0      0        0 eth0
10.100.98.0     *               255.255.255.0   U     1      0        0 eth0
default         10.10.54.230    0.0.0.0         UG    0      0        0 tun0
After connecting to VPN by doing $sudo openvpn torvpn-shadyabhi.ovpn my all internet traffic goes through VPN gateway. But, I want a way so that I can use both eth0 and tun0 simultaneously.

Any ideas on how can I accomplish that?
 
Old 01-17-2011, 12:08 PM   #2
mgbu
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by shadyabhi View Post
After connecting to VPN by doing $sudo openvpn torvpn-shadyabhi.ovpn my all internet traffic goes through VPN gateway. But, I want a way so that I can use both eth0 and tun0 simultaneously.

Any ideas on how can I accomplish that?
Not sure what you mean by using both simultaneously. A packet can only be transmitted on one interface - which one do you want to use? You can only have one default route - yours is through tun0. You can change your default route to eth0 easily but you can't have more than one at a time.
 
Old 01-17-2011, 07:05 PM   #3
xanthaos
LQ Newbie
 
Registered: Jan 2010
Posts: 7

Rep: Reputation: 1
Do you have a specific reason for needing to download from a vpn tunnel or are you wishing to increase bandwidth? If increasing bandwidth, this will be difficult, and usually requires use of an ether-channel, generally only available through high-end equipment such as Cisco switches and routers. If there are other reasons, I may not be able to help you with this one. Not sure if it's a tunnel issue or routing table issue.
 
Old 01-18-2011, 03:44 AM   #4
shadyabhi
LQ Newbie
 
Registered: Sep 2008
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by xanthaos View Post
Do you have a specific reason for needing to download from a vpn tunnel or are you wishing to increase bandwidth? If increasing bandwidth, this will be difficult, and usually requires use of an ether-channel, generally only available through high-end equipment such as Cisco switches and routers. If there are other reasons, I may not be able to help you with this one. Not sure if it's a tunnel issue or routing table issue.
Its a routing issue. I am not able to use iptables for conditional routing.
And, I dont want to increase bandwidth as my VPN is also running from the same internet connection so there is no way I can increase my bandwidth.
 
  


Reply

Tags
iptables, openvpn, policy, routing, vpn


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
iptables: preroute outgoing packets from tun0 to eth0 ? malo_umoran Linux - Networking 2 09-22-2010 02:35 AM
How to set a route for Eth1 (DHCP clients) to reach Tun0 (openvpn server)? CentOS torontob Linux - Networking 2 09-22-2010 12:14 AM
iptables question with OpenVPN (tun0 to tun0 filtering) fang0654 Linux - Server 3 09-30-2009 02:17 AM
OpenVPN : need help with understanding tun0 and P-t-P jonaskellens Linux - Networking 3 08-24-2009 01:27 AM
Iptables/TC: how to make masqueraded traffic go through an openVPN tun0? theVOID Linux - Networking 3 04-25-2008 03:34 AM


All times are GMT -5. The time now is 10:49 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration