1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-05-18 03:26:14 +02:00

Add routing configuration

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-07-23 22:08:42 +02:00
parent 73d4ab9388
commit 0584cd076c
4 changed files with 102 additions and 0 deletions

View file

@ -60,6 +60,12 @@ deploy() {
SERVICES="$SERVICES nft"
fi
svc=$(file_path_override "sysctl.conf")
if [ ! -z "$svc" ]; then
cp "$svc" "$DEPLOY/etc/sysctl.conf"
echo "etc/sysctl.conf m 644 0 0" >> "$DEPLOY/rootfs_files.txt"
fi
svc=$(file_path_override "interfaces")
if [ ! -z "$svc" ]; then
echo "etc/init.d/ifcfg m 777 0 0" >> "$DEPLOY/rootfs_files.txt"

View file

@ -0,0 +1,54 @@
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
ip protocol icmp accept
ct state {established, related} accept
ct state invalid drop
iifname lo accept
iifname port0 accept
iifname port1 accept
reject
}
chain forward {
type filter hook forward priority 0;
iifname port0 jump forward_port0
iifname port1 jump forward_port1
iifname port2 jump forward_port2
}
chain forward_port0 {
oifname port2 accept
reject
}
chain forward_port1 {
oifname port2 accept
reject
}
chain forward_port2 {
ct state related, established accept
drop
}
chain output {
type filter hook output priority 0; policy accept;
}
}
table ip nat {
chain prerouting {
type nat hook prerouting priority 0;
}
chain postrouting {
type nat hook postrouting priority 0;
oifname port2 masquerade
}
}

View file

@ -0,0 +1,41 @@
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
ct state {established, related} accept
ct state invalid drop
iifname lo accept
iifname wlan0 accept
ip protocol icmp accept
reject
}
chain forward {
type filter hook forward priority 0;
oifname port0 accept
iifname port0 ct state related, established accept
iifname port0 drop
}
chain output {
type filter hook output priority 0; policy accept;
}
}
table ip nat {
chain prerouting {
type nat hook prerouting priority 0;
}
chain postrouting {
type nat hook postrouting priority 0;
oifname port0 masquerade
}
}

View file

@ -0,0 +1 @@
net.ipv4.ip_forward=1