Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Port Forwarding on Rancher Desktop Networking #4096

Closed
Nino-K opened this issue Mar 4, 2023 · 7 comments
Closed

Manual Port Forwarding on Rancher Desktop Networking #4096

Nino-K opened this issue Mar 4, 2023 · 7 comments
Assignees
Milestone

Comments

@Nino-K
Copy link
Member

Nino-K commented Mar 4, 2023

During the experimental release of RD Networking, the port forwarding has to be performed manually. This is due to the privileged escalation (firewall prompt) that is required by the host-switch.exe. It is important to note that this will improve in the upcoming release and the manual step is no longer expected from our users.

When port forwarding is needed for e.g:

docker run --name mynginx1 -p 8801:80 -d nginx

In order to access the container via the exposed port manual step must be performed.

From WSL VM:

wsl -d rancher-desktop

Expose the desired port:

curl http://192.168.127.1:80/services/forwarder/expose -X POST -d '{"local":":8801","remote":"192.168.127.2:8801"}'

To Unxpose:

curl http://192.168.127.1:80/services/forwarder/unexpose -X POST -d '{"local":":8801","remote":"192.168.127.2:8801"}'

Related to: #3810

@Nino-K Nino-K added kind/bug Something isn't working area/networking labels Mar 4, 2023
@Nino-K
Copy link
Member Author

Nino-K commented Mar 4, 2023

@gunamata @sunilarjun please make sure we include this limitation in the release notes, furthermore, this will change in the upcoming release.

@gunamata
Copy link
Contributor

gunamata commented Mar 4, 2023

Thanks @Nino-K . Tagging @jandubois as he writes the release notes.

@jandubois
Copy link
Member

@Nino-K Is 192.168.127.1 a fixed IP address, or the address of the Windows host?

@jandubois jandubois added this to the Next milestone Mar 4, 2023
@jandubois jandubois added kind/documentation-devhelp For work that needs documenting but requires an engineer to help docs and removed kind/bug Something isn't working labels Mar 4, 2023
@Nino-K
Copy link
Member Author

Nino-K commented Mar 6, 2023

The 192.168.127.1 is a fixed IP address, it's a gateway address in the virtual network. The gateway is the windows host (host-switch.exe) however, the IP address is not accessible from windows itself, it can only be accessed from within the network namespace (virtual network) for now.

@jandubois
Copy link
Member

Oh, I see, I missed the wsl -d rancher-desktop part.

Maybe it would be better to tell people to use rdctl shell curl ... instead.

@Nino-K
Copy link
Member Author

Nino-K commented Mar 6, 2023

Maybe it would be better to tell people to use rdctl shell curl ... instead.

Oh, I didn't think about that, I will test and see if it works. If that works, that would be much better.

@Nino-K
Copy link
Member Author

Nino-K commented Mar 8, 2023

Once the attached PR is merged in, when the new networking is enabled you can use the following commands to expose and unexposed the ports.

expose:

rdctl shell curl http://192.168.127.1:80/services/forwarder/expose -X POST -d '{\"local\":\":8801\",\"remote\":\"192.168.127.2:8801\"}'

unexpose:

rdctl shell curl http://192.168.127.1:80/services/forwarder/unexpose -X POST -d '{\"local\":\":8801\",\"remote\":\"192.168.127.2:8801\"}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants