Changes

Jump to navigation Jump to search
704 bytes added ,  11:59, 30 October 2018
Line 27: Line 27:  
=== Add route to linux ===
 
=== Add route to linux ===
 
  ip route add 10.0.192.0/18 via 15.17.160.217 dev eth0
 
  ip route add 10.0.192.0/18 via 15.17.160.217 dev eth0
 +
 +
 +
 +
= With SystemD ==
 +
== Enable Nat Script ==
 +
<source lang="bash">#!/bin/bash
 +
Ariel=15.17.170.200
 +
Arrow=15.17.169.59
 +
Carabanchel=15.17.170.206
 +
Marito=15.17.160.181
 +
CarlosDuque=15.17.170.138
 +
Mapper=15.17.163.102
 +
 +
sudo sysctl -w net.ipv4.ip_forward=1
 +
 +
function clear_nat {
 +
    for i in $( sudo iptables -t nat -L -n -v --line-numbers | grep ^[0-9] | awk '{ print $1 }' )
 +
        do sudo iptables -t nat -D POSTROUTING 1
 +
    done
 +
}
 +
 +
function add_nat {
 +
    sudo iptables -t nat -A POSTROUTING -s ${1}/32 -o tun0 -j MASQUERADE
 +
}
 +
 +
clear_nat
 +
add_nat ${Ariel}
 +
add_nat ${Carabanchel}
 +
add_nat ${Arrow}
 +
add_nat ${CarlosDuque}
 +
add_nat ${Marito}
 +
add_nat ${Mapper}
 +
sudo iptables -t nat --line-numbers -L -n -v<source>

Navigation menu