First of all, i am sorry i don't know much about networking and i am beginner in linux networking. Please help me with my problem.

I have a Rpi3 and i am configured it as ethernet router from eth0 to eth1 interfaces. I have used USB to Ethernet converter for the eth1 interface. The output of ifconfig is shown below. ethernet router

I have configured Rpi3 as hotspot and observed the ifconfig and it shown below. wifi

For ethernet router, eth1 is not assigned with static IP until a device is connected to the eth1 port but for wifi hotspot it is assigned with a static IP even if there is no device connected.

What i am doing wrong. How to get a static IP for eth1 port even if no device is connected? Is there any way to assign default inet addr to ethernet ports?

Ethernet router configuration bash script is here

Wifi hotspot configuration bash script is here

  • Do you solved your problem? /etc/network/interfaces is deprecated and conflicts with dhcpcd. You should not use it.
    – Ingo
    Commented Jan 29, 2020 at 13:03
  • I found the solution. we can add a no-link option in the dhcpcd.conf file. this will solve my problem. So ethernet ip will be availed even if the no device is connected.
    – vishnu m c
    Commented May 28, 2020 at 11:42
  • Please make your comment/solution an answer and accept it after two days. Only accepting an answer will finish your question and it will not annoy us again all the years.
    – Ingo
    Commented May 28, 2020 at 11:53

1 Answer 1



sudo vi /etc/network/interfaces

add following

auto eth1

iface eth1 inet static

This is one of possible ways of adding static ip to new interface

  • i am using stretch version of raspbian. I already configured it using dhcpcd.conf. Please see my configuration bash script dpaste.de/NaTO#L14 . For configuring it as hotspot, see my hotspot script dpaste.de/E4WW
    – vishnu m c
    Commented Oct 17, 2017 at 4:55
  • what is the difference in interfaces file and dhcpcd.conf. When i set static ip through dhcpcd.conf, i won't get IP address for eth1 until a device is connected. But now i disabled dhcpcd.conf and use interfaces file for setting static IP and now eth1 assigned with IP address even if no device is connected. What is the reason behind this?
    – vishnu m c
    Commented Oct 17, 2017 at 6:12
  • Can we achieve the same using dhcpcd.conf file?
    – vishnu m c
    Commented Oct 17, 2017 at 12:05
  • yes, you can add into dhcp.config very similar records (instead of interfaces) interface eth1 static ip_address= static routers= static domain_name_servers=
    – Tamir
    Commented Oct 17, 2017 at 20:45
  • Please look my script. I am doing the same in the script. But it does not assign IP address until a device is connected to the port. That's my question friend?
    – vishnu m c
    Commented Oct 18, 2017 at 6:15

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.