Development discussion of WireGuard
 help / color / mirror / Atom feed
* [WireGuard] Using Network Namespaces for Default Routing
@ 2016-07-25 10:07 Jason A. Donenfeld
  0 siblings, 0 replies; only message in thread
From: Jason A. Donenfeld @ 2016-07-25 10:07 UTC (permalink / raw)
  To: WireGuard mailing list

Hey guys,

I had a small idea over the weekend of using network namespaces with
wireguard for controlling the default route, as a substitute for
0/1,128/1 or rule-based routing. I collected my thoughts on this here:
https://www.wireguard.io/netns/ with the relevant part in this section
https://www.wireguard.io/netns/#the-new-namespace-solution .

The basic gist is as follows:

# ip netns create physical
# ip link set eth0 netns physical
# iw phy phy0 set netns name physical
# ip -n physical link add wg0 type wireguard
# ip -n physical set wg0 netns 1
# ip netns exec physical dhcpcd wlan0
# ip netns exec physical wpa_supplicant -iwlan0
-c/etc/wpa_supplicant/wpa_supplicant.conf
# ip -n physical addr add 192.168.12.52/24 dev eth0
# wg setconf wg0 /etc/wireguard/wg0.conf
# ip addr add 10.2.4.5/32 dev wg0
# ip route add default dev wg0
# ip link set wg0 up

But there's a lot more detail on the page listed above. Interested in
hearing your feedback!

Regards,
Jason

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-25 10:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-25 10:07 [WireGuard] Using Network Namespaces for Default Routing Jason A. Donenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).