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 that needs to be access by . 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 Answer 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 is the default gateway for the network, it will need a route (probably a static route) for the network that points to the RPi at 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, that should be all you need.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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