On boot: "either "local" is duplicate, or "/24" is garbage"

Applications, development tools, FPGA, C, WEB
Post Reply
plauria
Posts: 11
Joined: Wed Jul 23, 2014 6:57 pm

On boot: "either "local" is duplicate, or "/24" is garbage"

Post by plauria » Mon Oct 06, 2014 10:30 pm

Hi all,

I'm using the 0.92 version of the RP software. I am trying to give my redpitaya a static IP for use on a switch. Here is my /etc/network/interfaces file:

Code: Select all

###########################
# lo: Loopback interface  #
###########################

auto lo
iface lo inet loopback


######################################
# eth0: Wired Ethernet - 1000Base-T  #
######################################
#
# Uncomment only one: dynamic or static configuration.
#

# Dynamic (DHCP) IP address
#iface eth0 inet dhcp
# Dynamic (DHCP) IP address
#iface eth0 inet dhcp
#    udhcpc_opts -t7 -T3

# Static IP address
# Don't forget to set the static DNS IP in sd:/etc/init.d/rcS too.
iface eth0 inet static
    address 192.168.1.222 
    netmask 255.255.255.0
    gateway 0.0.0.0
The network doesn't work, and the relevant bootup message regarding eth0 is given in the subject line.

To get it to work, I have to log into the RP using serial console, then do

Code: Select all

ifconfig eth0 down
ifconfig eth0 192.168.1.222
ifconfig eth0 up
Then it works fine. Why do I have to do this every time I boot the RP? What's going on? I must be missing something...

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: On boot: "either "local" is duplicate, or "/24" is garb

Post by Nils Roos » Tue Oct 07, 2014 12:18 am

I must be missing something...
You are ! Two things, possibly:
1. You also need to put your static configuration into the /etc/network/config file

Code: Select all

...
NETWORK=static

# Static network configuration parameters (active if NETWORK=static)
IP=...
NETMASK=...
GATEWAY=...
2. Since a few commits back, the access-point ("ap") configuration has become the default. If you are using the latest version from github repo, there is now a separate file /etc/network/interfaces.ap where you also need to change the settings.

The latter point has not yet been documented, unfortunately.

edit: Hmmm, just tested without the first change, I didn't get the same messages as you did ...

plauria
Posts: 11
Joined: Wed Jul 23, 2014 6:57 pm

Re: On boot: "either "local" is duplicate, or "/24" is garb

Post by plauria » Tue Oct 07, 2014 5:48 pm

Thanks for the reply, but neither of those files exist in /etc/network. When I create them, they are gone by next boot.

I'm using a stable release; on boot it reports this version: Red Pitaya GNU/Linux/Ecosystem version 0.92-378

plauria
Posts: 11
Joined: Wed Jul 23, 2014 6:57 pm

Re: On boot: "either "local" is duplicate, or "/24" is garb

Post by plauria » Tue Oct 07, 2014 6:05 pm

OK, I think I've discovered the error. Running ifup -v eth0 results in:

Code: Select all

redpitaya> ifup -fv eth0
run-parts /etc/network/if-pre-up.d
ip addr add 192.168.1.222 /24 dev eth0 label eth0
ip: either "local" is duplicate, or "/24" is garbage
ip link set eth0 up
ip route add default via 0.0.0.0 dev eth0
ip: RTNETLINK answers: File exists
There's a typo in the `ip` command!!! There should be no space between 222 and /24! Running the commands without the space between 222 and /24 and the RP works now. :shock:

I just checked my /etc/network/interfaces file and there is a stray space at the end of the IP address! This was getting collected by ifup, and hence causing the erroneous command. This should be noted in the wiki I think!

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: Google [Bot] and 24 guests