Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5278

Networking and servers • Share WLAN port to USB0, how to enable port forwarding?

$
0
0
Hello, I would want to ssh into a device that is connected to a Wireless LAN through a Raspberry Pi Zero W. To better explain what I mean, here is a quick rundown of the setup. There are three devices and a wireless LAN:
  • Mac
  • Raspberry Pi Zero W (called "gadget" from now on)
  • Raspberry Pi A (called "target" from now on)
This is how they are set up:

Code:

Access Point  <-- WLAN --> 10.0.0.57 wlan0 "gadget" usb0 10.1.1.100 < -- USB Cable --> usb0 10.1.1.50 "target""Mac" 10.0.0.204
I can:
  • ssh from Mac into gadget through the Wireless LAN
  • ssh from gadget to the target through usb0
I would like to:
  • ssh from Mac to target
There are at least two reasons for this to not work:
  • I would need port forwarding to be set up, e.g. ssh gadget -p 20022; The gadget would then forward to target:22.
  • Even if this is set up (I tried with nftables), there is another table created by NetworkManager on the gadget for the shared usb0 device, that prevents inbound traffic from anything but usb0.
Does anyone have any idea on how to:
  • Setup port forwarding as desired, possibly even using nmcli commands instead of nft commands?
  • Losen the restrictive table that gets created when NetworkManager sets up the shared connection?
Thanks! Martin

Statistics: Posted by Tinue — Mon Feb 26, 2024 3:46 pm



Viewing all articles
Browse latest Browse all 5278

Trending Articles