You are not logged in.

#1 2016-04-28 04:02:13

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

sharing internet connection to a router send traffic through vpn

I've been reading a lot because I hope to get this set up right the first time... I want to share an internet connection received from my modem/router/isp through an on board ethernet adapter(eth0) to a usb 3 gigabit ethernet adapter (eth1) and from the usb ethernet to a second router so devices connected to the second router can get online. Once I get that working I'd like to send all the traffic from the devices connected to the second router through a vpn(PIA).

Currently I'm using arch's default settings to get an ip via dhcp from my modem/router to my on-board ethernet adapter eth0 . My thought is to leave eth0 as is and use systemd-networkd to set a static ip for my usb 3 ethernet adapter eth1. Then I believe I can use dnsmasq to give my second router an ip and and dns from my device. Then enable packet forwarding and set iptables to finish the job. ATM I'm not sure if I should set up a dhcp server instead of dnsmasq though. 

I believe that will work to get internet to my second router, but as I said I'm not sure if I'm better off setting up dhcpd instead. I don't currently have the vpn client setup on my device that I will be routing my traffic through. I was hoping to get the second router situation settled before trying to add the vpn into the mix. Would I be better off having the vpn set up first and getting everything done at once?

Once the router is getting internet access and devices can connect to it, I think then all I should have to do is change the rules in my iptables to use tun0(or whatever the vpn's virtual adapter is named) instead of eth0 and set the vpn's dns in dnsmasq. Is that right? One thing I'm not sure about with dns mask are the dns servers and the different ethernet adapters. Can I keep eth0 using the default dns from my ISP and still use my vpn's dns servers for the second router? I don't want to mess up my current connection as I'm doing this all via ssh.

ATM I'm not sure what the best route of attack is for this project and I'm very open to suggestions. I've set up a hostapd access point before and routed the traffic through vpn, but it was quite slow and the range was poor. I'm pretty sure it was because that project was done on a raspberry pi with a less than great wifi adapter. When I did the PI AP I used isc-dhcp-server and was able to set the dns in its conf to PIA's dns server since traffic was going to them anyway.

Here is what I followed to setup the pi as an ap: https://learn.adafruit.com/setting-up-a … t/overview then I just set iptables so traffic went through the vpn.

Offline

#2 2016-04-28 14:22:10

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: sharing internet connection to a router send traffic through vpn

If you're having problems with the Arch for the Pi that's its own board AFAIK. Even if it's for regular Arch, we don't have a clearly worded question or any relevant information D: . Relevant information in this case would be errors, logs, what you've tried, and a much, much shorter question. Note that a question such as "How do I share my internet connection?" will warrant a lot less replies than "dhcpcd has stopped working with error ABCD after trying to share internet connection". The first one implies you want us to do the work for you, the second one gives us a hopefully real error we can troubleshoot. I hope I'm making sense. Unfortunately my networking skills are horrible, so I can't really help you in this regard. But I hope you can get your project working soon!


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#3 2016-04-28 17:01:53

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

Re: sharing internet connection to a router send traffic through vpn

I have two ethernet ports, one to get internet from my isp, and one which I'd like to share an internet connection through. The shared internet connection would be shared a router so I would have a separate network. I'd like to route my traffic for only the second network through a vpn, the device sharing its connection to the second router/separate network would be a vpn client. The vpn service is private internet access and they have their own dns that I would be using for only the second network. My router/modem from my isp will be providing a reserved dhcp ip address and dns to the device with which I'd like to share it's internet connection.

To get my second router/separate network running I was planning on setting up a dhcp server on the second ethernet port, the one sharing the connection. That was my plan till I started reading and found out about dnsmasq. I saw a bunch of people on a bunch of different forums recommending it for it's ease of use and reliability.

For my situation am I better off with dhcpd, dnsmasq, is there a better program/app to use for what I want to do?

The pi was an old project, I'm using an odroid xu4 for this with arch arm. I didn't really think this was an arm specific question or even one specific to arch itself, arch arm just happens to be what I'm running. as I haven't started setting this up yet, I'm just seeking a little direction in hopes of getting this set up right the first time. I not sure what approach to take and/or if dnsmasq will suite my needs.

I've never used dnsmasq, I just started reading about it a few days ago and am still trying to decide if it will work for me. I've seen it recommended more than a couple times for sharing an internet connection, but I'm having trouble finding info on sharing internet specifically to a router.

Honestly I have more options than I've presented, the router will accept dynamic(dhcp), static, pptp, pppoe, and something called telstra big pond. I've set up a dhcp server before to do the RPi AP, that's why I was leaning toward that route of getting things running.

Offline

Board footer

Powered by FluxBB