Changes

Jump to navigation Jump to search
396 bytes added ,  13:50, 31 October 2018
Line 49: Line 49:     
function add_nat {
 
function add_nat {
     sudo iptables -t nat -A POSTROUTING -s ${1}/32 -o tun0 -j MASQUERADE
+
     sudo iptables -t nat -A POSTROUTING -s ${1}/32 -d 10.0.192.0/18 -o tun0 -j MASQUERADE
 +
}
 +
 
 +
function add_wlan_nat {
 +
    sudo iptables -t nat -A POSTROUTING -s ${1}/32 -o wlan0 -j MASQUERADE
 
}
 
}
   Line 59: Line 63:  
add_nat ${Marito}
 
add_nat ${Marito}
 
add_nat ${Mapper}
 
add_nat ${Mapper}
sudo iptables -t nat --line-numbers -L -n -v</source>
+
add_wlan_nat ${Carabanchel}
 +
 
 +
sudo iptables -t nat --line-numbers -L -n -v
 +
</source>
    
== Stop Script ==
 
== Stop Script ==
Line 77: Line 84:  
clear_nat
 
clear_nat
 
sudo iptables -t nat --line-numbers -L -n -v</source>
 
sudo iptables -t nat --line-numbers -L -n -v</source>
 +
 +
== Multiple routes for one source ==
 +
* The more specific rule must go first
 +
sudo iptables -t nat -A POSTROUTING -s 15.17.170.206 -d 10.0.192.0/18 -o tun0 -j MASQUERADE
 +
sudo iptables -t nat -A POSTROUTING -s 15.17.170.206 -o wlan0 -j MASQUERADE

Navigation menu