0

What I want to do :

Device A (PLC, static ip=100.10.10.11) 
        |
        | eth0 connection 
        |
Device B (raspberry B3, Rasbian lite)
        |
        | wlan0 (wi-fi) OR USB to Network adapter 
        |
Device C (laptop)

I did edit the dhcpcd.conf file :

sudo nano /etc/dhcpcd.conf

Like this :

interface eth0

static ip_address=100.10.10.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1


#interface wlan0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1

What else I need to do to ping or connect Device A from Device C?

2

First of all: you should not use public routable ip addresses like 100.10.10.11. They are reserved to be used on the internet. Instead use ip addresses for Private networks. 10.10.10.11 would be fine.

Configuration for eth0 in /etc/dhcpcd.conf should be set to:

interface eth0
static ip_address=10.10.10.10/24
static domain_name_servers=192.168.0.1

The static router must be on the same subnet as the interface. So setting it to 192.168.0.1 doesn't make sense. Anyway you should only use one static router (default gateway). Usually this is set automatically on the other interface wlan0 if it is configured by DHCP. You will find your default gateway with:

rpi ~$ ip route

Also the domain name server 192.168.0.1 must be reachable from the RasPi. Is it? Otherwise you will have difficulties with name resolution on Device A.

In addition you must enable ip forwarding in /etc/sysctl.conf. Just uncomment this line:

#net.ipv4.ip_forward=1

and reboot.

Now you should be able to ping or connect Device A from Device C.

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.