Skip to content

Instantly share code, notes, and snippets.

@enricostano
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enricostano/bc5f8ecd7c4614448ade to your computer and use it in GitHub Desktop.
Save enricostano/bc5f8ecd7c4614448ade to your computer and use it in GitHub Desktop.
# /etc/systemd/network/br0.netdev
[NetDev]
Name=br0
Kind=bridge
# /etc/systemd/network/br0.network
[Match]
Name=br0
[Network]
Address=10.0.3.1/24
λ brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.c27be397d24c no vethVER4VO
Chain PREROUTING (policy ACCEPT 6 packets, 552 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 6 packets, 552 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 134 packets, 8894 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 134 packets, 8894 bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- * wlan0 10.0.3.0/24 0.0.0.0/0
# Generated by iptables-save v1.4.21 on Sun Aug 23 16:02:57 2015
*filter
:INPUT ACCEPT [587:329452]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [543:53206]
COMMIT
# Completed on Sun Aug 23 16:02:57 2015
# Generated by iptables-save v1.4.21 on Sun Aug 23 16:02:57 2015
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 10.0.3.0/24 -o wlan0 -j MASQUERADE
COMMIT
# Completed on Sun Aug 23 16:02:57 2015
~ λ sudo route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 302 0 0 wlan0
10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.1.0 0.0.0.0 255.255.255.0 U 302 0 0 wlan0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment