Compare commits
No commits in common. "c00468eaea2641ce1c0aa60a3d50d8c4a0204cec" and "5e22dcadf13e8786a82cc7b07e1c9658b2f4be2b" have entirely different histories.
c00468eaea
...
5e22dcadf1
2 changed files with 2 additions and 9 deletions
|
@ -13,13 +13,6 @@ RULES=(
|
|||
"443:4430"
|
||||
"443:4430/udp"
|
||||
"22:22"
|
||||
"3478:3478"
|
||||
"3478:3478/udp"
|
||||
"25:2500"
|
||||
"143:1430"
|
||||
"465:4650"
|
||||
"587:5870"
|
||||
"993:9930"
|
||||
)
|
||||
|
||||
# Runs the actual script
|
||||
|
|
|
@ -14,6 +14,7 @@ add_NAT_forwarding() {
|
|||
forward_to_port="$6"
|
||||
|
||||
firewall-cmd --add-rich-rule "rule family=\"ipv4\" destination address=\"$original_destination_ip\" forward-port port=\"$original_destination_port\" protocol=\"$tcp_or_udp\" to-addr=\"$forward_to_ip\" to-port=\"$forward_to_port\"" --permanent > /dev/null
|
||||
firewall-cmd --reload > /dev/null
|
||||
|
||||
echo "+ [$interface_source][$tcp_or_udp] $original_destination_ip:$original_destination_port --> $forward_to_ip:$forward_to_port"
|
||||
}
|
||||
|
@ -32,6 +33,7 @@ remove_NAT_forwarding() {
|
|||
forward_to_port="$6"
|
||||
|
||||
firewall-cmd --remove-rich-rule "rule family=\"ipv4\" destination address=\"$original_destination_ip\" forward-port port=\"$original_destination_port\" protocol=\"$tcp_or_udp\" to-addr=\"$forward_to_ip\" to-port=\"$forward_to_port\"" --permanent > /dev/null
|
||||
firewall-cmd --reload > /dev/null
|
||||
|
||||
echo "- [$interface_source][$tcp_or_udp] $original_destination_ip:$original_destination_port --> $forward_to_ip:$forward_to_port"
|
||||
}
|
||||
|
@ -76,6 +78,4 @@ for rule in "${RULES[@]}"; do
|
|||
esac
|
||||
done
|
||||
|
||||
firewall-cmd --reload > /dev/null
|
||||
|
||||
echo -e "\nDone! Don't forget to add/remove the rules in the security list."
|
||||
|
|
Loading…
Reference in a new issue