|
|
@ -1,5 +1,20 @@ |
|
|
|
#! /sbin/nft -f |
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify |
|
|
|
# it under the terms of the GNU General Public License as published by |
|
|
|
# the Free Software Foundation, either version 3 of the License, or |
|
|
|
# (at your option) any later version. |
|
|
|
# |
|
|
|
# This program is distributed in the hope that it will be useful, |
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
# GNU General Public License for more details. |
|
|
|
# |
|
|
|
# You should have received a copy of the GNU General Public License |
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
|
|
|
|
|
# Copyright © 2018-2019 Hugo Levy-Falk <hugo@klafyvel.me> |
|
|
|
|
|
|
|
table ip nat { |
|
|
|
|
|
|
|
set radius_federez { |
|
|
@ -10,8 +25,8 @@ table ip nat { |
|
|
|
chain prerouting { |
|
|
|
type nat hook prerouting priority 0; |
|
|
|
ip saddr $range_prerezotage ip daddr != { $intranet, $comnpay, $website } tcp dport {http,https} dnat $bounce_server; |
|
|
|
ip saddr @radius_federez ip daddr $ip_self_public tcp dport { 636, 389 } dnat $ip_radius; |
|
|
|
ip saddr @radius_federez ip daddr $ip_self_public udp dport { 636, 1812 } dnat $ip_radius; |
|
|
|
ip saddr @radius_federez ip daddr $ip_self_public tcp dport { 636, 389 } dnat $ip_radius; |
|
|
|
ip saddr @radius_federez ip daddr $ip_self_public udp dport { 636, 1812 } dnat $ip_radius; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -20,8 +35,8 @@ table ip nat { |
|
|
|
|
|
|
|
meta oifname != $if_supelec return |
|
|
|
|
|
|
|
ip saddr $ip_radius ip daddr @radius_federez tcp dport { 636, 389} snat to $ip_self_public |
|
|
|
ip saddr $ip_radius ip daddr @radius_federez udp dport { 636, 1812 } snat to $ip_self_public |
|
|
|
ip saddr $ip_radius ip daddr @radius_federez tcp dport { 636, 389} snat to $ip_self_public |
|
|
|
ip saddr $ip_radius ip daddr @radius_federez udp dport { 636, 1812 } snat to $ip_self_public |
|
|
|
|
|
|
|
ip daddr != {10.0.0.0/8, $range_public} ip saddr vmap { |
|
|
|
$range_adherent : goto adherent_nat, |
|
|
@ -30,7 +45,7 @@ table ip nat { |
|
|
|
$range_aloes : goto aloes_nat, |
|
|
|
$range_prerezotage : goto prerezotage_nat |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ip daddr != {10.0.0.0/8, $range_public} ip saddr != $range_public snat to $ip_self_public |
|
|
|
} |
|
|
|
|
|
|
|