{"id":22954802,"url":"https://github.com/sgabe/ipgates","last_synced_at":"2025-04-02T00:26:45.613Z","repository":{"id":88189094,"uuid":"72762596","full_name":"sgabe/ipgates","owner":"sgabe","description":"A simple Python script to setup DNAT and SNAT using iptables.","archived":false,"fork":false,"pushed_at":"2016-11-24T19:11:10.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T15:45:17.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sgabe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-03T16:04:19.000Z","updated_at":"2023-06-06T20:27:30.000Z","dependencies_parsed_at":"2023-04-16T14:56:05.688Z","dependency_job_id":null,"html_url":"https://github.com/sgabe/ipgates","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgabe%2Fipgates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgabe%2Fipgates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgabe%2Fipgates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgabe%2Fipgates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgabe","download_url":"https://codeload.github.com/sgabe/ipgates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246732360,"owners_count":20824722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T16:19:40.530Z","updated_at":"2025-04-02T00:26:45.593Z","avatar_url":"https://github.com/sgabe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"IPGates\n===============\n\n**IPGates** is a simple Python script to setup DNAT and SNAT using iptables. It allows e.g. non-root users to interact with netfilter in order to setup destination NAT and source NAT through a Linux gateway using iptables. It does so by providing a very limited interface to interact with iptables. All available services for destination NAT are stored in a configuration file. A cron job will automatically remove the new DNAT rules every evening around 6PM. All events are logged to /var/log/ipgates.log for accountability. \n\n## Usage\n\nChoose the type of the NAT rule (`--dnat` for destination and `--snat` for source NAT) to be added or deleted (`-d`). Then choose one from the available services (`-s`) for DNAT or specify the internal (`-i`) and external (`-e`) IP addresses for source NAT. You can also just simply list all currently effective rules (`--list`).\n\n### Options\n```\n$ python ipgates.py -h\n\n                    It's not \"Door to Heaven\"... it is...\n                   _____ _____   _____       _\n                  |_   _|  __ \\ / ____|     | |   v0.3.1\n                    | | | |__) | |  __  __ _| |_ ___  ___\n                    | | |  ___/| | |_ |/ _` | __/ _ \\/ __|\n                   _| |_| |    | |__| | (_| | ||  __/\\__ \\\n                  |_____|_|     \\_____|\\__,_|\\__\\___||___/\n\nusage: ipgates [-h] (--dnat | --snat | --list) [-i INTERNAL] [-e EXTERNAL]\n               [-s {http,https,smb,sftp,dns}] [-d]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --dnat                setup destination NAT\n  --snat                setup source NAT\n  --list                list all rules\n  -i INTERNAL           internal IP address for source NAT\n  -e EXTERNAL           external IP address for source NAT\n  -s {http,https,smb,sftp,dns}\n  -d                    remove rule\n\nexamples:\n  - adding a destination NAT rule:\n      $ python ipgates.py --dnat -s https\n  - removing a destination NAT rule:\n      $ python ipgates.py --dnat -s smb -d\n  - adding a source NAT rule:\n      $ python ipgates.py --snat -i 192.168.123.123 -e 123.123.123.123\n  - removing a source NAT rule:\n      $ python ipgates.py --snat -i 192.168.123.123 -e 123.123.123.123 -d\n  - listing all rules:\n      $ python ipgates.py --list\n```\n\n## License\nThis project is licensed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgabe%2Fipgates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgabe%2Fipgates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgabe%2Fipgates/lists"}