LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-02-2016, 06:45 PM   #1
cricketbat
LQ Newbie
 
Registered: Jan 2016
Posts: 1

Rep: Reputation: Disabled
Network Namespaces - how to connect namespace to physical network circumventing VPN


I know nothing about *nix, just usage of google to learn what I can. What I'm trying to do is fairly simple and I think I am just missing something obvious. I have a machine running Ubuntu 14.04 that is connected to my VPN service provider with an openvpn connection. All traffic is routed through the VPN with this setup.

What I want to do is run Steam on this machine in its own namespace to connect directly to the internet without using the VPN connection. This is because in home streaming from my other machines obviously won't work if Steam connects over the VPN connection.

I am trying to do this with a network namespace. I've found plenty of examples of using the namespace to run the VPN within and using the namespace to just use certain programs with the VPN, but I want to have everything use the VPN and a namespace that does not use the VPN just for Steam.

I can create the network namespace and link it to the main network space easily. What I haven't figured out is how to provide external access to the internet for the namespace, I believe this is simple, and I'm also not certain how I'd connect the namespace to the internet avoiding the VPN operating in the main network space.

So far I've done this


Quote:
sudo ip netns add steam
sudo ip link add veth0 type veth peer name veth1
sudo ip link set veth1 netns steam
sudo ip netns exec steam ifconfig lo up
sudo ip netns exec steam ifconfig veth1 10.1.1.1/24 up
sudo ifconfig veth0 10.1.1.2/24 up

To get internet access to the namespace I've tried examples I've seen using a bridge, which I failed miserably at resulting in no network access on the machine at all, and others that suggest using iptables to route internet traffic to the namespace. I understand it revolves around providing access to the veth0 virtual adapter in the main network space so it can provide it to the linked veth1 in the steam namespace, I just can't get it right. I'm also not certain if/how I can do this avoiding the active VPN in the main network space.


Here is what the network looks like without any of the steam network namespace modifications.



route -n results

Quote:
Kernel IP routing table


Destination----Gateway--------Genmask-------------Flags---Metric--Ref--Use--Iface

0.0.0.0 --------10.9.0.166------0.0.0.0---------------UG-------0------0-----0----tun0

10.9.0.1--------10.9.0.166------255.255.255.255----UGH-----0------0-----0----tun0

10.9.0.166------0.0.0.0--------255.255.255.255------UH------0-------0-----0----tun0

xx.xxx.xx.xx---192.168.1.1-----255.255.255.255----UGH-----0-------0-----0----eth0
^^^^^^=vpn external IP

192.168.1.0-----0.0.0.0---------255.255.255.0-------U------1-----0----0-----eth0


ifconfig results


Quote:
eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.1.33 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21a:4dff:fe4f:63f0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3239090 errors:0 dropped:7 overruns:0 frame:0
TX packets:6333617 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:423243251 (423.2 MB) TX bytes:8672067376 (8.6 GB)




lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:139214 errors:0 dropped:0 overruns:0 frame:0
TX packets:139214 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:172125088 (172.1 MB) TX bytes:172125088 (172.1 MB)




tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.9.0.165 P-t-P:10.9.0.166 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:1017279 errors:0 dropped:0 overruns:0 frame:0
TX packets:1580136 errors:0 dropped:24937 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:208288016 (208.2 MB) TX bytes:1375993303 (1.3 GB)
Thanks in advance!
 
Old 01-03-2016, 07:06 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
An alternative would be to add routes to the Steam IPs through your eth0 gateway.
 
  


Reply



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
Can't ping/connect to network share from VPN tunnel jsav CentOS 1 09-18-2015 09:53 AM
trying to connect a VPN network arman moradi Linux - Security 2 09-09-2014 07:08 PM
[SOLVED] Racoon 0.8 to Juniper VPN will only connect to one network at a time grog_7 Linux - Networking 1 03-23-2012 04:55 PM
RHEL 6.1 & Juniper VPN network connect tommaso-o Linux - Networking 2 02-25-2012 03:10 PM
VPN client to connect to my school's network lowpro2k3 Linux - Networking 2 09-01-2005 09:10 PM

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

All times are GMT -5. The time now is 05:23 PM.

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