Xplosionist
Posts: 8
Joined: Sun Mar 04, 2018 9:07 pm

problems with stretch static ip dhcpcd

Mon Mar 05, 2018 6:17 am

I am sorry for starting a new topic on this, but I have tried many of the recipes I've found here and on the net, and am still having problems.

I have a Pi3, and am trying to set up wlan0 to get an "outside" address via DHCP, and statically set up a network on eth0. I am running raspbian stretch lite, 11-27-2017.

I have read that I shouldn't do anything in /etc/network/interfaces. When I did, I got the static on eth0 set up right, but dhcpcd wouldn't start, so I undid that. I set the static for eth0 in dhcpcd.conf by adding the following to the bottom of the stock dhcpcd.conf:

Code: Select all

interface eth0
static ip_address=192.168.111.1/24
With this set up this way, I boot without errors from anything, but there is no address configured on eth0 at all. I tried adding (to dhcpcd.conf) the routers= and domain_name_servers= lines just to match what I saw in others examples, but that didn't help either. And, is not what I want in the end. I have dnsmasq installed, and configured it to run on eth0, with a specified range, but haven't gotten to working on that yet as the basic interface isn't coming up.

Mostly unmodified system, trying to get these interfaces configured for my needs, and to run dnsmasq providing a gateway/router.

Can anyone help me figure out what I'm missing? Thanks.

lbog
Posts: 108
Joined: Sun Mar 06, 2016 9:44 am

Re: problems with stretch static ip dhcpcd

Mon Mar 05, 2018 9:52 am

Xplosionist wrote:
Mon Mar 05, 2018 6:17 am
I have a Pi3, and am trying to set up wlan0 to get an "outside" address via DHCP, and statically set up a network on eth0. I am running raspbian stretch lite, 11-27-2017.

Can anyone help me figure out what I'm missing? Thanks.
You could use systemd-networkd.

In the /etc/dhcpcd.conf:

Code: Select all

denyinterfaces eth0
#interface eth0
#static ip_address=192.168.111.1/24
Create the file "lan_eth0.network":

Code: Select all

sudo nano /etc/systemd/network/lan_eth0.network
with the content:

Code: Select all

[Match]
Name=eth0

[Network]
DHCP=none
LinkLocalAddressing=no
IPv4LL=false
IPv6LL=false
Address=192.168.111.1/24
enable systemd-network:

Code: Select all

sudo systemctl enable systemd-networkd
systemctl status systemd-networkd
After a reboot, test with:

Code: Select all

ip a
systemctl status systemd-networkd
systemctl is-enabled systemd-networkd
systemctl is-active systemd-networkd

Xplosionist
Posts: 8
Joined: Sun Mar 04, 2018 9:07 pm

Re: problems with stretch static ip dhcpcd

Mon Mar 05, 2018 2:46 pm

lbog wrote:
Mon Mar 05, 2018 9:52 am
You could use systemd-networkd.
I could try that. Is that what's recommended? I haven't seen that in other setup articles, so was assuming I'd done something wrong. Is something I'm doing unusual or incompatible with the "configure dhcpcd to do addressing" method?

Thanks. Any disadvantage to switching to systemd-networkd? ie, does it change the operation of the system for any other common expectations?

SurferTim
Posts: 1648
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: problems with stretch static ip dhcpcd

Mon Mar 05, 2018 2:50 pm

I use /etc/dhcpcd.conf, and it works for me. Ensure you have added nothing to /etc/network/interfaces.

Code: Select all

interface eth0
static ip_address=192.168.111.1/24

Xplosionist
Posts: 8
Joined: Sun Mar 04, 2018 9:07 pm

Re: problems with stretch static ip dhcpcd

Mon Mar 05, 2018 3:52 pm

Yup. Currently, there's a stock /etc/network/interfaces, and lines as you note in dhcpcd.conf. But, the interface has no addresses on it. Anywhere I can look to see why dhcpcd isn't doing for me what it is for you?

SurferTim
Posts: 1648
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: problems with stretch static ip dhcpcd

Mon Mar 05, 2018 4:15 pm

sudo service dhcpcd status
That should show what the service did.

Xplosionist
Posts: 8
Joined: Sun Mar 04, 2018 9:07 pm

Re: problems with stretch static ip dhcpcd

Mon Mar 05, 2018 7:52 pm

Thanks. Okay, I guess I thought of this possibility, but the output of "service dhcpcd status" suggests that it's a link state issue.

Code: Select all

...
Mar 05 07:17:04 raspberry dhcpcd[329]: eth0: waiting for carrier
...
I hadn't tried plugging anything in yet. Technically, it shouldn't be needed, but I guess dhcpcd waits to apply the given static config until after link is established?

I just confirmed that adding a cable and providing link causes the address to come up. :-/

Any way to avoid that need for a link? I don't know how much I care, it just goes against my decades old understanding of how things work.

Thanks!

SurferTim
Posts: 1648
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: problems with stretch static ip dhcpcd

Mon Mar 05, 2018 9:54 pm

Xplosionist wrote: Thanks. Okay, I guess I thought of this possibility, but the output of "service dhcpcd status" suggests that it's a link state issue.

Code: Select all

...
Mar 05 07:17:04 raspberry dhcpcd[329]: eth0: waiting for carrier
...
I hadn't tried plugging anything in yet. Technically, it shouldn't be needed, but I guess dhcpcd waits to apply the given static config until after link is established?

I just confirmed that adding a cable and providing link causes the address to come up. :-/

Any way to avoid that need for a link? I don't know how much I care, it just goes against my decades old understanding of how things work.

Thanks!
The interface isn't assigned network settings until the interface is up (connected).

lbog
Posts: 108
Joined: Sun Mar 06, 2016 9:44 am

Re: problems with stretch static ip dhcpcd

Mon Mar 05, 2018 10:56 pm

Xplosionist wrote:
Mon Mar 05, 2018 7:52 pm

Code: Select all

...
Mar 05 07:17:04 raspberry dhcpcd[329]: eth0: waiting for carrier
...
Any way to avoid that need for a link?
Try with:

Code: Select all

nolink
noup
in the "/etc/dhcpcd.conf".

Xplosionist
Posts: 8
Joined: Sun Mar 04, 2018 9:07 pm

Re: problems with stretch static ip dhcpcd

Tue Mar 06, 2018 7:32 pm

lbog wrote:
Mon Mar 05, 2018 10:56 pm
Try with:

Code: Select all

nolink
noup
in the "/etc/dhcpcd.conf".
Thanks! I added nolink, and now it behaves the way I expect it to. Much appreciated...

shivaVMC
Posts: 5
Joined: Sat Jul 14, 2018 6:21 am

Re: problems with stretch static ip dhcpcd

Sat Jul 14, 2018 10:15 am

I tried the way suggested in above step..Nothing working for me.
Kindly request to support on the same.

DirkS
Posts: 8074
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: problems with stretch static ip dhcpcd

Sat Jul 14, 2018 12:12 pm

shivaVMC wrote:
Sat Jul 14, 2018 10:15 am
I tried the way suggested in above step..Nothing working for me.
Kindly request to support on the same.
Which step? And exactly what is the problem?
What changes did you make (details place)

shivaVMC
Posts: 5
Joined: Sat Jul 14, 2018 6:21 am

Re: problems with stretch static ip dhcpcd

Sat Jul 14, 2018 1:14 pm

Hi,
I have configured dhcpcd.conf with static IP/gate way as below

interface eth0
static ip_address=13.13.13.12/24
static routers= 13.13.13.13
sudo systemctl enable systemd-networkd
systemctl status systemd-networkd
nolink

ip a
systemctl status systemd-networkd

Commented everything in /etc/network/interfaces path.

I m not able to detect the LAN cable in "carrier" path of Rpi3b+ board when I connect to my device and when I connect from Rpi3b+ to my Laptop with same cable,then its detecting in "carrier" path.

I m frustated on this fix,please help on quick fix

DirkS
Posts: 8074
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: problems with stretch static ip dhcpcd

Sat Jul 14, 2018 2:55 pm

shivaVMC wrote:
Sat Jul 14, 2018 1:14 pm
I have configured dhcpcd.conf with static IP/gate way as below

interface eth0
static ip_address=13.13.13.12/24
static routers= 13.13.13.13
sudo systemctl enable systemd-networkd
systemctl status systemd-networkd
nolink

ip a
systemctl status systemd-networkd
Is all this in dhcpcd.conf?
You should not put commands in that file...

User avatar
DougieLawson
Posts: 33020
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: problems with stretch static ip dhcpcd

Sat Jul 14, 2018 7:58 pm

Also if you're not at Xerox in Connecticut you should not be hijacking one of their 13.0.0.0/11 addresses.

Use a non-routable addres from: 10.xxx.xxx.xxx/8 or 172.[16-31].xxx.xxx/16 or 192.168.xxx.xxx/24
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

shivaVMC
Posts: 5
Joined: Sat Jul 14, 2018 6:21 am

Re: problems with stretch static ip dhcpcd

Mon Jul 16, 2018 6:17 am

No No No !!! ..commands are submitted in terminal ,only IP configuration have done in dhcp file.

I have configured 192.168.1.12 IP in my PC still no LED's of Rpi are blinking and no connectivity ..

I m frustrated to fix this issue.Kind suggest on it.

DirkS
Posts: 8074
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: problems with stretch static ip dhcpcd

Mon Jul 16, 2018 8:25 am

shivaVMC wrote:
Mon Jul 16, 2018 6:17 am
No No No !!! ..commands are submitted in terminal ,only IP configuration have done in dhcp file.

I have configured 192.168.1.12 IP in my PC still no LED's of Rpi are blinking and no connectivity ..

I m frustrated to fix this issue.Kind suggest on it.
Back to the start:
Make sure /etc/network/interfaces is in its original state (pretty much empty)
Add static dhcp in /etc/dhcpd.conf. As Dougie says: don't use the 13.x ip address. Post the contents here in a code block.
Don't mess around with stopping / starting network (systemctl), just reboot

BTW:
still no LED's of Rpi are blinking
What LEDs? I hope you just mean network leds (?) I hope the power (red) LED is on...

Return to “Troubleshooting”

Who is online

Users browsing this forum: Baidu [Spider] and 30 guests