I am using RPI3 with raspbian and I have it connected to my personnal network via wifi (works fine) but I also connected it to company network with cable. Also I am new to RPi and Linux.

So I have two interfaces active wlan0 and eth0. I dont use DHCP for neither. Problem is that I am able to ping just some of my company devices, not all of them so I think the problem is with routers so I tried to setup my RPI as any other PC inside company network.

My eth0 should be:

but when I run route -n I get this:         UG    200    0        0 wlan0         UG    300    0        0 eth0     U     300    0        0 eth0   U     200    0        0 wlan0

As I said wlan0 is fine, metric works fine but I dont know why there is and mask

I tried route add {ip} via {gw} without any change. I also tried to change my dhcpcd.conf file which now looks like this:

interface wlan0
static routers=
static domain_name_servers=
static domain_search=
static ip_address=
metric 200

interface eth0
metric 300
static ip_address=
static routers=
static domain_name_servers=
static domain_search=

But there is no way to setup netmask. So how should I do that?


ip route result default via dev wlan0 src metric 200 default via dev eth0 src metric 300 dev eth0 proto kernel scope link src metric 300 dev wlan0 proto kernel scope link src metric 200

I cant ping but I can ping

  • 2
    The /24 sets the netmask to 24 bits
    – Dougie
    Commented Dec 5, 2018 at 7:40
  • also, not all computers respond to ping Commented Dec 5, 2018 at 7:44
  • @Jaromanda X that is true but I am trying to ping Plcs and they all responde to ping
    – Somachr
    Commented Dec 5, 2018 at 7:49
  • You can see that I already have set /24
    – Somachr
    Commented Dec 5, 2018 at 7:51
  • give an example of a non responsive ping IP address ... does it start with 172.23.125 ? Commented Dec 5, 2018 at 7:51

1 Answer 1


Your company uses the private ip address range with a 12 bit address mask, in particular:

address block: – (1.048.576 addresses)
network: or

Writing or netmask is equivalent. This private network block can be split into subnets for example that one that is set on your RasPi:

address block: – (65.536 addresses)
network: or

Now you can see that the ip address is part of this block but not the address You can only ping the former. You have to increase the subnet. If you use the hole private network then you are on the save side. I don't know if this may have some side effects on your companies network. It could be split into other subnets with router so your RasPi may be confused. To get an idea about this you can look at the network settings of the host with ip address and with

Another issue is that you set a static ip address on the RasPi for the companies network. I don't believe that your company manages its network with static ip addresses but with DHCP. So simply setting a static ip address may conflict with another host which has get the same ip address by DHCP. This will not only break the RasPis communication but also your colleagues one.

I just can't see why you do not can set another netmask. It may be that other conditions on your setup doesn't make sense to set a lower netmask so it is simply suppressed. I suggest to clean up first your subnetting and then look again at this issue.

You also try to use the companies gateway (for internet access?) by setting it to But as shown its default route has a higher metric (300) than the default route to your wlan router with ip address and metric 200 so the last one will be used first if available. Is this what you want? If not you should avoid setting two gateways (default routes).

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.