You are not logged in.

#1 2013-01-25 22:46:03

johnh
Member
Registered: 2013-01-25
Posts: 2

Static IP frustration :)

Well that was the craziest Capatcha - ever!

I've installed the latest arch linux release on a Reapberry Pi B, booted up, SSH'ed in, created a new user and all is good. Except that I'm really struggling to assign a static IP, I have a DHCP assigned IP so can connect but dhcp assigned addresses can changed so I need to assign a static IP.

Following the newbeginners guide https://wiki.archlinux.org/index.php/Beginners%27_Guide I have:

* added an address
# ip addr add 192.168.100.16/255.255.255.0 dev eth0

* added a gateway
# ip route add default via 192.168.100.1

* have a resolv.conf file
# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
domain HomeHoward
nameserver 192.168.100.1
# /etc/resolv.conf.tail can replace this line

This did not work so then I moved on to the Network configuration page and :

Created the file /etc/systemd/system/network.service


[Unit]
Description=Network Connectivity
Wants=network.target
Before=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/network
ExecStart=/sbin/ip link set dev ${interface} up
ExecStart=/usr/sbin/wpa_supplicant -B -i ${interface} -c /etc/wpa_supplicant.co$
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${$
ExecStart=/sbin/ip route add default via ${gateway}

ExecStop=/sbin/ip addr flush dev ${interface}
ExecStop=/sbin/ip link set dev ${interface} down

[Install]
WantedBy=multi-user.target



Created the file /etc/conf.d/network

interface=eth0
address=192.168.100.16
netmask=255.255.255.0
broadcast=192.168.100.255
gateway-192.168.100.1


Then I didn't forget to enable it!

# systemctl enable network



But I still get the DHCP assigned IP address of 192.168.100.110 rather than the static IP 192.168.100.16


This does not bode well for my first forray into the world on Linux - please can someone tell me where I am going wrong? Please?

Offline

#2 2013-01-25 22:55:53

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,950
Website

Re: Static IP frustration :)

You probably have dhcpcd running. You are also not running Arch Linux (which is x86 only and you are on arm)

Offline

#3 2013-01-26 05:50:20

johnh
Member
Registered: 2013-01-25
Posts: 2

Re: Static IP frustration :)

Hi Pierre and thanks for your reply.

As you probably guessed I am a newbie and not sure what ARM refers to, am I not using ARCH or is this a specific distribution (specifically for the PI for example) and am I therefore in the wrong forum? Apologies if this is the case.

After some research I stopped the DHCPCD service with the
sudo systemctl disable dhcpcd
command and rebooted.

After checking the service was stopped with
sudo systemctl status dhcpcd
dhcpcd.service - dhcpcd on all interfaces
          Loaded: loaded (/usr/lib/systemd/system/dhcpcd.service; disabled)
          Active: inactive (dead)

However the IP continues to be 192.168.100.110 instead of the specified 192.168.100.16 sad

How is this even possible when the dhcpdc service has been stopped??? Could dhcpcd have saved a config file somewhere?

The only file in /etc/network.d/interfaces/ is a file called ethernet-static and its contents is


CONNECTION='ethernet'
DESCRIPTION='A basic static ethernet connection using iproute'
INTERFACE='eth0'
IP='static'
ADDR='192.168.100.16'
#ROUTES=('192.168.100.1/24 via 192.168.100.1')
GATEWAY='192.168.100.1'
DNS=('192.168.100.1')

## For IPv6 autoconfiguration
#IP6=stateless

## For IPv6 static address configuration
#IP6='static'
#ADDR6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')
#ROUTES6=('abcd::1234')
#GATEWAY6='1234:0:123::abcd'




this is a little frustrating for what should be a trivial task! Any help gratefully received.

Offline

#4 2013-01-26 06:31:13

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,079

Re: Static IP frustration :)

Arch does not work on Raspberry Pi. However a port of Arch called ArchARM does which is most likely what you are using.

Please ask on their forum as they will be able to better assist you. They in fact also have a sub-forum for Pi

http://www.archarm.org/board/


As a policy we only support Archlinux. https://wiki.archlinux.org/index.php/Fo … pport_ONLY


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2013-01-26 14:49:07

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 3,769

Re: Static IP frustration :)

Also, instead of hardcoded static, just asign static ip trough dhcp.


Evil #archlinux@freenode channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB