Using RPi 3 model B with latest Raspbian Lite Jessie (4.9). RPi is connected to network via WiFi (192.168.0.5), and to a network printer via ethernet. I'm trying to make the printer available via WiFi, using it's built-in print server and not a USB-Cups-solution. Thus, I thought I was trying to bridge wlan0 and eth0, however, that seems to be impossible. So I'm trying to route instead, but without much luck – I can't even get WiFi and ethernet to be working at the same time. Printer is using a static IP (192.168.0.3), so no DHCP required. If possible, I would like to use the printer in the same subnet as everything else.
/etc/dhcpcd.conf:
...
interface eth0
static ip_address=192.168.0.6/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
/etc/sysctl.conf:
...
net.ipv4.ip_forward=1
...
Routing:
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
But as soon as I bring up eth0, wlan0 stops working. Pinging the router (192.168.0.1) brings up a Destination Host Unreachable
, pinging the printer works; by changing the interface I can reach the router via ping -I wlan0 192.168.0.1
. However, the RPi remains unreachable for any other device on the network.