router(host): configure public (v4) network
All checks were successful
/ Ansible Lint (push) Successful in 4m20s
All checks were successful
/ Ansible Lint (push) Successful in 4m20s
This commit is contained in:
parent
f7306b91a6
commit
291ebce943
4 changed files with 40 additions and 6 deletions
|
|
@ -7,14 +7,19 @@ define if_net1_v4_wan = "net1"
|
|||
define if_net2_v6_wan = "net2"
|
||||
define if_net0_2_v4_nat = "net0.2"
|
||||
define if_net0_3_ci_runner = "net0.3"
|
||||
define if_net0_5_public = "net0.5"
|
||||
|
||||
# Interface Groups
|
||||
define wan_ifs = { $if_net1_v4_wan,
|
||||
$if_net2_v6_wan }
|
||||
define lan_ifs = { $if_net0_2_v4_nat,
|
||||
$if_net0_3_ci_runner }
|
||||
# define v4_exposed_ifs = { }
|
||||
define v6_exposed_ifs = { $if_net0_2_v4_nat }
|
||||
$if_net0_3_ci_runner,
|
||||
$if_net0_5_public }
|
||||
define v4_exposed_ifs = { $if_net0_5_public }
|
||||
define v6_exposed_ifs = { $if_net0_2_v4_nat,
|
||||
$if_net0_5_public }
|
||||
define v4_nat_ifs = { $if_net0_2_v4_nat,
|
||||
$if_net0_3_ci_runner }
|
||||
|
||||
|
||||
## Rules
|
||||
|
|
@ -73,7 +78,7 @@ table ip v4nat {
|
|||
chain postrouting {
|
||||
type nat hook postrouting priority srcnat; policy accept;
|
||||
|
||||
oifname $if_net1_v4_wan masquerade
|
||||
iifname $v4_nat_ifs oifname $if_net1_v4_wan masquerade
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -89,7 +94,7 @@ table inet forward {
|
|||
meta nfproto ipv4 iifname $lan_ifs oifname $if_net1_v4_wan accept comment "allow v4 internet access"
|
||||
|
||||
# Allow access to exposed networks from internet.
|
||||
# meta nfproto ipv4 oifname $v4_exposed_ifs accept comment "allow v4 exposed network access"
|
||||
meta nfproto ipv4 oifname $v4_exposed_ifs accept comment "allow v4 exposed network access"
|
||||
meta nfproto ipv6 oifname $v6_exposed_ifs accept comment "allow v6 exposed network access"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue