1

Network

  • Router A is connected to the ISP.
  • Router B is connected to Router A wirelessly.
  • Router B has a VPN client.
  • Devices connect to Router B wirelessly.

Requirements

I want Router B to be able to send traffic to Router A through the VPN client by default, and to also have a configurable whitelist of ips/domains/mac-addresses that should be sent directly to Router A. Router A sends all traffic to the ISP.

Questions

I have no networking knowledge, so I have a few questions:

  • How can Router B send packets wirelessly to/from Router A while also accepting wireless connections from other devices? How is traffic between Router B and Router A setup (i.e. what tools, programs, concepts are used?)?
  • How can Router B split incoming traffic between sending directly to Router A or sending to the VPN client?

I don't expect answers to be step by step implementation guides. I'm interested in answers that guide me towards the correct tools and concepts for each requirement.

4
  • VPN's have two end points, one is clearly router B in your question, where is the other end point? Are you trying to encrypt the traffic travelling over the wireless to router A? Mar 30, 2017 at 10:47
  • @djsmiley2k The other endpoint would be the VPN service. Router B would send the traffic to the VPN service through Router A since that's the one connected to the internet. What I'm not sure about is how to make Router B forward traffic to Router A.
    – user712622
    Mar 30, 2017 at 10:53
  • Also what kind of VPN is that, specifically? (Does it connect you to the internet, or to an actual 'private network'?) Either way, doing that in a separate router will likely need a bit of (S)NAT, in addition to regular routing, but overall it's not a complex configuration. Mar 30, 2017 at 10:54
  • Ok, VPN's provide a routing list of what traffic should pass over the VPN. You should ideally be able to adjust this via the vpn provider, or locally on router B's config. Mar 30, 2017 at 10:55

1 Answer 1

0

How is traffic between Router B and Router A setup (i.e. what tools, programs, concepts are used?)?

The main concept you'll have to research is the routing table (which is how routers select routes). It's an integral part of each OS's network stack and you probably already have tools for managing it – ip route on Linux; route and netstat -rn on Windows and BSDs.

Although for this particular task, though, you'll likely also need to implement NAT (SNAT i.e. masquerading) for outgoing VPN traffic – usually that's a feature of the firewall, e.g. iptables, pf, or nft.

(You might need NAT because your devices send packets with their LAN IP address, which the VPN server probably won't expect.)

How can Router B split incoming traffic between sending directly to Router A or sending to the VPN client?

In the routing table, the more specific entry always wins. So if you add a "direct" route for a specific IP address and a "VPN" route for the entire internet, it'll work as you describe.

(Note that regular routes are based on destination address only. While "policy routing" based on protocol & port is also possible, it needs a bit more configuration.)

How can Router B send packets wirelessly to/from Router A while also accepting wireless connections from other devices?

Ideally, use a wired Ethernet connection between the two routers. Running a cable can avoid quite a few problems.

Technically routers don't accept wireless connections – access points do. If your router has an AP built in, most likely it can only handle one network at once (and even then, most of them only support AP mode, not client/station mode).

So if you require wireless uplink, you might need a separate device for that. Dedicated APs (aka "wireless extenders") frequently have a client mode.

2
  • > Technically routers don't accept wireless connections – access points do. > So if you require wireless uplink, you might need a separate device for that. Ah, I might be using the lingo imprecisely. Router B will be a single board computer running Linux. It would be able to function as router, access point, or anything really. But thanks, I'll read more about access points.
    – user712622
    Mar 30, 2017 at 17:30
  • @crzrcn: In that case, it might support multiple Wi-Fi networks at once (check combinations under iw phy – it varies between Wi-Fi chips), but most likely it'll still be limited to 1 frequency for both, and the performance will probably be awful. Mar 30, 2017 at 18:46

You must log in to answer this question.