Last active
March 21, 2018 12:02
-
-
Save aeciojr/3cd3ee80e787b09519ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Esta cofiguração permite acessar tunel vpn estabelecido no linux à partir duma VM Windows com interface bridge. | |
########## NO LINUX ########## | |
# backup do sysctl.conf | |
cp -Rfa /etc/sysctl.conf{,.ori} | |
# habilitando ip forward no sysctl.conf | |
sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/g' /etc/sysctl.conf | |
# Carregando novos parametros no kernel | |
sysctl --load /etc/sysctl.conf | |
# Validando | |
sysctl -a|grep net.ipv4.ip_forward | |
# Regras iptables (*** atenção p/ interface de entrada, no meu caso usei a bridge0 ***) | |
iptables -t nat -A POSTROUTING --out-interface tun0 -j MASQUERADE | |
iptables -A FORWARD --in-interface bridge0 -j ACCEPT | |
########## NO WINDOWS ########## | |
# adição de rota permanente (*** atencao p/ o endereço ip de saída***) | |
route add 200.238.83.0 mask 255.255.255.0 10.81.1.83 -P |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment