Skip to content

Instantly share code, notes, and snippets.

@enricostano
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save enricostano/bc5f8ecd7c4614448ade to your computer and use it in GitHub Desktop.

Select an option

Save enricostano/bc5f8ecd7c4614448ade to your computer and use it in GitHub Desktop.

Revisions

  1. enricostano revised this gist Aug 23, 2015. 2 changed files with 12 additions and 3 deletions.
    12 changes: 12 additions & 0 deletions iptables
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    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
    3 changes: 0 additions & 3 deletions iptables.rules
    Original file line number Diff line number Diff line change
    @@ -12,8 +12,5 @@ COMMIT
    :OUTPUT ACCEPT [0:0]
    :POSTROUTING ACCEPT [0:0]
    -A POSTROUTING -s 10.0.3.0/24 -o wlan0 -j MASQUERADE
    -A POSTROUTING -s 10.0.3.0/24 -o wlan0 -j MASQUERADE
    -A POSTROUTING -s 10.0.3.0/24 -o wlan0 -j MASQUERADE
    -A POSTROUTING -s 10.0.3.0/24 -o wlan0 -j MASQUERADE
    COMMIT
    # Completed on Sun Aug 23 16:02:57 2015
  2. enricostano revised this gist Aug 23, 2015. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions iptables.rules
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    # 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
    -A POSTROUTING -s 10.0.3.0/24 -o wlan0 -j MASQUERADE
    -A POSTROUTING -s 10.0.3.0/24 -o wlan0 -j MASQUERADE
    -A POSTROUTING -s 10.0.3.0/24 -o wlan0 -j MASQUERADE
    COMMIT
    # Completed on Sun Aug 23 16:02:57 2015
  3. enricostano revised this gist Aug 23, 2015. 2 changed files with 12 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions br0.netdev
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # /etc/systemd/network/br0.netdev

    [NetDev]
    Name=br0
    Kind=bridge
    7 changes: 7 additions & 0 deletions br0.network
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # /etc/systemd/network/br0.network

    [Match]
    Name=br0

    [Network]
    Address=10.0.3.1/24
  4. enricostano revised this gist Aug 23, 2015. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions brctl show
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    λ brctl show br0
    bridge name bridge id STP enabled interfaces
    br0 8000.c27be397d24c no vethVER4VO
  5. enricostano created this gist Aug 23, 2015.
    6 changes: 6 additions & 0 deletions routes
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    ~ λ 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