2024-02-07 00:21:45 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Static configuration for the host we are NATting towards
|
|
|
|
# * ORIGINAL_DESTINATION_IP is the private IP corresponding to the desired public IP
|
|
|
|
# * RULES contains "original_destination_port:forward_to_port"
|
|
|
|
INTERFACE_SOURCE="ens3"
|
|
|
|
ORIGINAL_DESTINATION_IP="10.0.0.104"
|
|
|
|
FORWARD_TO_IP="10.0.100.10"
|
|
|
|
RULES=(
|
|
|
|
"25:25"
|
2024-08-05 21:37:16 +02:00
|
|
|
"80:80"
|
|
|
|
"443:443"
|
|
|
|
"22:2222"
|
2024-02-07 00:21:45 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# Runs the actual script
|
|
|
|
CURRENT_DIR="$(dirname "$(readlink -f "$0")")"
|
|
|
|
. "$CURRENT_DIR/configure_NAT_from_RULES"
|