mirror of
https://github.com/pygos/build.git
synced 2024-11-22 02:59:47 +01:00
Add routing configuration
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
parent
73d4ab9388
commit
0584cd076c
4 changed files with 102 additions and 0 deletions
|
@ -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"
|
||||
|
|
54
product/router/alix/nftables.rules
Normal file
54
product/router/alix/nftables.rules
Normal 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
|
||||
}
|
||||
}
|
41
product/router/rpi3/nftables.rules
Normal file
41
product/router/rpi3/nftables.rules
Normal 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
|
||||
}
|
||||
}
|
1
product/router/sysctl.conf
Normal file
1
product/router/sysctl.conf
Normal file
|
@ -0,0 +1 @@
|
|||
net.ipv4.ip_forward=1
|
Loading…
Reference in a new issue