feat: Add a script to manage port-forwarding on server #22

Closed
tom wants to merge 1 commit from feat/port-forwarding into main
Owner

Usage:

$ sudo bash port-forwarding.sh
Usage: port-forwarding.sh [COMMAND] [OPTIONS]

Commands:
    init                                Initialize port forwarding environment
    add <ext_port> <int_ip> <int_port> <protocol>  Add port forwarding rule
    remove <ext_port> <int_ip> <int_port> <protocol>  Remove port forwarding rule
    list                                List all port forwarding rules
    flush                               Remove all port forwarding rules
    save                                Save current rules to file

Examples:
    port-forwarding.sh init
    port-forwarding.sh add 80 192.168.1.10 80 tcp
    port-forwarding.sh add 8080 192.168.1.20 80 tcp
    port-forwarding.sh add 53 192.168.1.5 53 udp
    port-forwarding.sh remove 80 192.168.1.10 80 tcp
    port-forwarding.sh list
    port-forwarding.sh save

Configuration:
    External Interface: eno1
    Internal Interface: wg0

Note: Edit the script to change interface names if needed.
Usage: ```bash $ sudo bash port-forwarding.sh Usage: port-forwarding.sh [COMMAND] [OPTIONS] Commands: init Initialize port forwarding environment add <ext_port> <int_ip> <int_port> <protocol> Add port forwarding rule remove <ext_port> <int_ip> <int_port> <protocol> Remove port forwarding rule list List all port forwarding rules flush Remove all port forwarding rules save Save current rules to file Examples: port-forwarding.sh init port-forwarding.sh add 80 192.168.1.10 80 tcp port-forwarding.sh add 8080 192.168.1.20 80 tcp port-forwarding.sh add 53 192.168.1.5 53 udp port-forwarding.sh remove 80 192.168.1.10 80 tcp port-forwarding.sh list port-forwarding.sh save Configuration: External Interface: eno1 Internal Interface: wg0 Note: Edit the script to change interface names if needed. ```
tom self-assigned this 2025-08-02 22:32:58 +02:00
Usage:

```bash
$ sudo bash port-forwarding.sh
Usage: port-forwarding.sh [COMMAND] [OPTIONS]

Commands:
    init                                Initialize port forwarding environment
    add <ext_port> <int_ip> <int_port> <protocol>  Add port forwarding rule
    remove <ext_port> <int_ip> <int_port> <protocol>  Remove port forwarding rule
    list                                List all port forwarding rules
    flush                               Remove all port forwarding rules
    save                                Save current rules to file

Examples:
    port-forwarding.sh init
    port-forwarding.sh add 80 192.168.1.10 80 tcp
    port-forwarding.sh add 8080 192.168.1.20 80 tcp
    port-forwarding.sh add 53 192.168.1.5 53 udp
    port-forwarding.sh remove 80 192.168.1.10 80 tcp
    port-forwarding.sh list
    port-forwarding.sh save

Configuration:
    External Interface: eno1
    Internal Interface: wg0

Note: Edit the script to change interface names if needed.
```
tom closed this pull request 2025-10-26 15:21:28 +01:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
inetsix-configs/dotfiles!22
No description provided.