Skip to content

Support gid-based routing and allow tunnel localhost ports #873

Merged
brianmay merged 7 commits intosshuttle:masterfrom
fatanugraha:master
Aug 7, 2023
Merged

Support gid-based routing and allow tunnel localhost ports #873
brianmay merged 7 commits intosshuttle:masterfrom
fatanugraha:master

Conversation

@fatanugraha
Copy link

@fatanugraha fatanugraha commented Aug 4, 2023

Add --group flag to filter network traffic emitted by the given group.

This flag is useful especially when we want to run sshuttle on a docker container with --net=host but doesn't have the luxury to setup a new user to filter the traffic that we want to tunnel so that it wont affect the other container.

Allow user to tunnel localhost port in the remote host.

This is useful for users that uses sshuttle to tunnel their traffic to a jumpbox that has some sidecars listening on 127.0.0.1 on that server. e.g. sshuttle -r <remote> 0/0 127.0.0.1:8200/32

Afterwards, users can reserve port 8200 so that the kernel won't allocate port on 8200 using ip_local_reserved_ports in Linux.

This MR only enable this capability for iptables because I don't have access to test other firewalls.

@brianmay
Copy link
Member

brianmay commented Aug 6, 2023

In general looks good to me.

Some of these functions, e.g. main, have a huge number of parameters. This is likely to result in bugs with parameters being passed in the wrong order (for example). Think at some point this really needs to be refactored somehow.

I will merge after the flake8 issue is fixed.

Thanks!

@fatanugraha
Copy link
Author

Whoops sorry, I have fixed the issues that flake8 raises.

Think at some point this really needs to be refactored somehow.

Agree 100%. Maybe for starter we can try by using a dataclass to pass in the parameters i think 🤔

@brianmay brianmay merged commit 9f718e8 into sshuttle:master Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants