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: 125
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: 1764
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: 1764
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: 1764
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: 125
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: 10
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: 9241
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: 10
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: 9241
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: 34160
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: 10
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: 9241
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...

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

Re: problems with stretch static ip dhcpcd

Fri Jul 20, 2018 8:37 am

DougieLawson wrote:
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
Hi Dougie,
When I configured my Laptop to 13.13.13.15 and rpi3b+ as 13.13.13.12 the connectivity through Ethernet is established and I could able to transfer file too and fro and Ethernet LED's are blinking.
But in similar way, my Embedded device is configured with IP 13.13.13.13 and rpi3b+ as 13.13.13.12 .No connection is established over ethernet and no LEDs of ethernet port are blinking.

Below are the commands I have passed in terminal.

In Raspbarry Pi 3B+ :

sudo ifconfig eth0 13.13.13.12 netmask 255.255.255.0 up

In Embedded device I have set 13.13.13.13.

Even though No improvwmnt on my work and no connnectivity established..Since 6 Days I m struggling to fix this issue.

Kind request to support on this

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

Re: problems with stretch static ip dhcpcd

Mon Jul 23, 2018 5:50 am

I m using ethernet ,to make direct connection from rpi to my board.
Rpi IP-13.13.13.12
My Board Flashed with IP 13.13.13.13
But No Eth0 link is up and None of ethernet LED's are blinking.

Interesting thing is when I connect Rpi(13.13.13.12) to switch and from switch to my Board(13.13.13.13) without any changes in configurationn/IP..Just I brought switch as intermediate between Rpi and My board.Then link is UP and application is working fine on/from my board.

So what could be the switch handling here inside it..I m confused on this.
I tried to block the firewall also and check with arp-n command where MAC address of my board is not registered.But when connected via switch MAC address is registered and handshaking is happening and working fine.

Please suggest on this to make my board work by removing on extra hardware(i.e., switch).

Thanks in advance.

Ernst
Posts: 693
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: problems with stretch static ip dhcpcd

Mon Jul 23, 2018 6:20 am

1) Identify Rpi, is it something you can eat ?
2) Identify "my board", is it something you made yourself ?
3) Try another LAN cable
4) Try another LAN cable, in this case an X-over cable
5) Cut cable used in 3) and count the number of wires, if 4 wires then try cable with 8, if 8 wires try cable with 4 (maybe x-over needed)
My first computer was an ICT1500, my first "personal" computer was the Science of Cambridge Mk14, followed by a TRS-80 Model I later

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

Re: problems with stretch static ip dhcpcd

Mon Jul 23, 2018 6:31 am

Ernst wrote:
Mon Jul 23, 2018 6:20 am
4) Try another LAN cable, in this case an X-over cable
5) Cut cable used in 3) and count the number of wires, if 4 wires then try cable with 8, if 8 wires try cable with 4 (maybe x-over needed)
No cross-over cable needed; the Pi has autosense ethernet sockets.

Ernst
Posts: 693
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: problems with stretch static ip dhcpcd

Mon Jul 23, 2018 6:58 am

DirkS wrote:
Mon Jul 23, 2018 6:31 am
Ernst wrote:
Mon Jul 23, 2018 6:20 am
4) Try another LAN cable, in this case an X-over cable
5) Cut cable used in 3) and count the number of wires, if 4 wires then try cable with 8, if 8 wires try cable with 4 (maybe x-over needed)
No cross-over cable needed; the Pi has autosense ethernet sockets.
That might be true, but I will only believe it when it has been tested this in all configurations, like direct connect between a Pi3B+ to a "device" with 100TX using only 2 pairs.
My first computer was an ICT1500, my first "personal" computer was the Science of Cambridge Mk14, followed by a TRS-80 Model I later

User avatar
rpdom
Posts: 12871
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: problems with stretch static ip dhcpcd

Mon Jul 23, 2018 7:04 am

Ernst wrote:
Mon Jul 23, 2018 6:58 am
DirkS wrote:
Mon Jul 23, 2018 6:31 am
No cross-over cable needed; the Pi has autosense ethernet sockets.
That might be true, but I will only believe it when it has been tested this in all configurations, like direct connect between a Pi3B+ to a "device" with 100TX using only 2 pairs.
Trust me. It works.

Ernst
Posts: 693
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: problems with stretch static ip dhcpcd

Mon Jul 23, 2018 7:13 am

rpdom wrote:
Mon Jul 23, 2018 7:04 am
Ernst wrote:
Mon Jul 23, 2018 6:58 am
DirkS wrote:
Mon Jul 23, 2018 6:31 am
No cross-over cable needed; the Pi has autosense ethernet sockets.
That might be true, but I will only believe it when it has been tested this in all configurations, like direct connect between a Pi3B+ to a "device" with 100TX using only 2 pairs.
Trust me. It works.
Do you know what device is being used ? :)
My first computer was an ICT1500, my first "personal" computer was the Science of Cambridge Mk14, followed by a TRS-80 Model I later

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

Re: problems with stretch static ip dhcpcd

Mon Jul 23, 2018 7:49 am

I m using Raspberry Pi3B+ device.
If its autosense ethernet sockets,then what would be issue to communicate with "my board" from Raspberry pi3B+ via ethenet.

Return to “Troubleshooting”