User Tools

Site Tools


linux:asrouter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux:asrouter [2018/07/01 10:46]
els created
linux:asrouter [2020/12/26 20:55] (current)
els
Line 1: Line 1:
 With this snippet all requests to interface wlx74..55c will be routed to wlp2s0 With this snippet all requests to interface wlx74..55c will be routed to wlp2s0
  
-<Code:bash>+<code:bash>
 #!/bin/bash #!/bin/bash
 sudo sysctl -w net.ipv4.ip_forward=1 sudo sysctl -w net.ipv4.ip_forward=1
Line 7: Line 7:
 sudo iptables -t nat -A POSTROUTING --out-interface wlp2s0 -j MASQUERADE sudo iptables -t nat -A POSTROUTING --out-interface wlp2s0 -j MASQUERADE
 sudo iptables -A FORWARD --in-interface wlx74da387e955c -j ACCEPT sudo iptables -A FORWARD --in-interface wlx74da387e955c -j ACCEPT
-</Code>+</code> 
 + 
 +If more then only this two interfaces define it like this: 
 +<​code:​bash>​ 
 +#​!/​bin/​bash 
 +sudo sysctl -w net.ipv4.ip_forward=1 
 + 
 +sudo iptables -t nat -A POSTROUTING --out-interface wlp2s0 -j MASQUERADE 
 +sudo iptables -A FORWARD --in-interface wlx74da38e2e914 --out-interface enp8s0 -m state --state RELATED,​ESTABLISHED -j ACCEPT 
 +sudo iptables -A FORWARD --in-interface enp8s0 --out-interface wlx74da38e2e914 -j ACCEPT 
 +</​code>​ 
linux/asrouter.txt · Last modified: 2020/12/26 20:55 by els