Add iptables/nftables test.

pull/29/head
necro-nemesis 6 years ago
parent f279c1c3d8
commit e08fce2041

@ -218,22 +218,22 @@ function default_configuration() {
# #RASPAP is for removal
# select iptables or nftables
# function networktables() {
# if [ ! -f /usr/sbin/iptables-nft ]; then
# tablerouteA='iptables -t nat -A POSTROUTING -s 10.3.141.0\/24 -o lokitun0 -j MASQUERADE #RASPAP'
# tablerouteB='iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP'
# fi
# sudo apt-get -y install nftables
# tablerouteA='nft add rule ip nat POSTROUTING oifname "lokitun0" ip saddr 10.3.141.0\/24 counter masquerade #RASPAP'
# tablerouteB='nft add rule ip nat POSTROUTING counter masquerade #RASPAP'
# }
function networktables() {
if [ ! -f /usr/sbin/iptables-nft ]; then
tablerouteA='iptables -t nat -A POSTROUTING -s 10.3.141.0\/24 -o lokitun0 -j MASQUERADE #RASPAP'
tablerouteB='iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP'
fi
sudo apt-get -y install nftables
tablerouteA='nft add rule ip nat POSTROUTING oifname "lokitun0" ip saddr 10.3.141.0\/24 counter masquerade #RASPAP'
tablerouteB='nft add rule ip nat POSTROUTING counter masquerade #RASPAP'
}
lines=(
'echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward #RASPAP'
'iptables -t nat -A POSTROUTING -s 10.3.141.0\/24 -o lokitun0 -j MASQUERADE #RASPAP'
'iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP'
#echo $tablerouteA
#echo $tablerouteB
#'iptables -t nat -A POSTROUTING -s 10.3.141.0\/24 -o lokitun0 -j MASQUERADE #RASPAP'
#'iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP'
"$tablerouteA"
"$tablerouteB"
'sudo \/var\/lib\/lokinet\/.\/lokilaunch.sh start #RASPAP'
)

Loading…
Cancel
Save