bashforward
Usage
sudo ./bashforward.sh
Follow the interactive prompts to configure:
- IP version to use (v4 or v6)
- External port that will be exposed to the internet
- Destination IP that will be forwarded externally (v4 or v6)
- Destination port that will be forwarded to the external port
Example Use Cases
Port forwarding a wireguard client that has a webserver to a wireguard server so then it can be reached from the internet. wireguard client ( 10.7.0.2 port 80 ) -> wireguard server ( 123.123.123.123 port 8080 )
Then when going to http://123.123.123.123:8080 it will be forwarding from http://10.7.0.2:80
⚠️ Important Notes
- Creates systemd service: /etc/systemd/system/port-forwarding.service
- Configuration saved in /root/port-forwarding.sh
- Enables IP forwarding in sysctl