0

I have the following network configuration

enter image description here

I have a Raspberry PI and its designated as PC1. As we can see, its Wifi and Ethernet (wlan, and eth0), are use at the same time. How do we make PC3 (a computer) access PC2(a ethernet device that has IP address)? There is some resource in PC2 like 192.168.43.222:5453 that needs to be access by 192.168.1.2 . Also, The connection between PC1 (raspberry) and PC2 is ethernet, while between PC1 and PC3 is wireless.

What are the necessary configurations need to be done on /etc/network/interfaces to make Raspberry Pi, sort of a bridge between the 2 networks.

1

You'll need to set up routing on the RPi.

  1. Enable IP forwarding:

    echo 1 > /proc/sys/net/ipv4/ip_forward

  2. Assuming 192.168.1.1 is the default gateway for the 192.168.1.0/24 network, it will need a route (probably a static route) for the 192.168.43.0/24 network that points to the RPi at 192.168.1.20. How to do this will depend on your router.

  3. You'll want to set the Wireless router as the RPi's default gateway over the wireless network.

If you have the RPi set for the default gateway for 192.168.43.0/24, that should be all you need.

Alternately, you could simply set up NAT on the RPi and redirect inbound ports on 192.168.1.20 to the inside computer at 192.168.43.2222.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.