Can't assign static ip automatically on boot

Ask questions about Arch Linux ARM. Please search before making a new topic.

Can't assign static ip automatically on boot

Postby gonny95 » Tue Mar 31, 2015 1:31 am

Hi, I have cubietruck(cubieboard3) and installed arch linux on it.
I tried to assign static ip on this machine

I can assign it manually
but I can't do it automatically

Here's what I tried:

1.
enabled only netctl-ifplugd@eth0.service
used default dhcp profile
the service started well but I want static ip

2.
enabled only netctl-ifplugd@eth0.service
used static ip profile
etc/netctl/eth0:
Interface=eth0
Connection=ethernet
ExcludeAuto=no
Address=('192.168.0.254/24')
Gateway='192.168.0.1'
DNS=('168.126.63.1' '168.126.63.2')
..

but not working (loaded,inactive,dead)

journalctl -b:
..
Timed out waiting for device sys-sbsystem-net-devices-eth0.device
Dependency failed for Automatic wired network connection using netctl profiles
Timed out waiting for device dev-ttyS0.device
Dependency failed for Dependency failed for Serial Getty on ttyS0
..

I looked at
/etc/systemd/system/multi-user.target.w ... h0.service
[Unit]
..
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
ExecStart=/usr/bin/ifplugd -i %I -r /etc/ifplugd/netctl.action -bfIns
[Install]
WantedBy=multi-user.target

So I tried to manually execute
/usr/bin/ifplugd -i eth0 -r /etc/ifplugd/netctl.action -bfIns
or
netctl start eth0
working.. static IP assigned.. that's weird

3.
disabled ifplugd
(systemctl disable netctl-ifplugd@eth0.service)

and enabled eth0
(netctl enable eth0)
both

netctl.service
netctl@eth0.service

are loaded,inactive dead

journalctl -b:
..
Timed out waiting for device sys-sbsystem-net-devices-eth0.device
Dependency failed for A basic static ethernet connection
Timed out waiting for device dev-ttyS0.device
Dependency failed for Serial Getty on ttyS0
..

I looked at

/usr/lib/systemd/system/netctl.service:
[Unit]
..
Before=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=-/usr/bin/netctl restore (I don't know what dash means)
ExecStart=/usr/bin/netctl store
[Install]
WantedBy=multi-user.target

/usr/lib/systemd/system/netctl@.service:
[Unit]
..
Before=network.target netctl.service
Wants=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/network/network start %I
ExecStop=/usr/lib/network/network stop %I

/etc/systemd/system/multi-user.target.w ... h0.service:
.include /usr/lib/systemd/system/netctl@.service
[Unit]
..
BindsTo=sys-subsystem-net-devices-eth0.device
After=sys-subsystem-net-net-devices-eth0.device

/etc/systemd/system/netctl@eth0.service:
.include /usr/lib/systemd/system/netctl@service
[Unit]
..
BindsTo=sys-subsystem-net-devices-eth0.device
After=sys-subsystem-net-devices-eth0.device

I executed /usr/bin/netctl store and /usr/bin/netctl restore
and It had no effect
I executed /usr/lib/network/network start %I
and static ip assigned
netctl start eth0 didn't work

4.
enabled both
(systemctl enable netctl-ifplugd@eth0.service)
(netctl enable eth0)

journalctl -b:
..
Timed out waiting for device sys-sbsystem-net-devices-eth0.device
Dependency failed for Automatic wired network connection using netctl profiles
Timed out waiting for device dev-ttyS0.device
Dependency failed for Dependency failed for Serial Getty on ttyS0
..

the result was same I can execute executable manually but services

netctl-ifplugd@eth0.service
netctl.service
netctl@eth0.service

are loaded inactive dead

start service manually by typing

netctl start eth0 didn't work
gonny95
 
Posts: 5
Joined: Tue Mar 31, 2015 1:26 am

Re: Can't assign static ip automatically on boot

Postby gonny95 » Tue Mar 31, 2015 10:15 am

Ok I found solution myself

I enabled only netctl-ifplugd@eth0.service
used static ip profile
etc/netctl/eth0:
Interface=eth0
Connection=ethernet
ExcludeAuto=no
Address=('192.168.0.254/24')
Gateway='192.168.0.1'
DNS=('168.126.63.1' '168.126.63.2')

And delete these two lines from service file

BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device

Since sys-subsystem-net-devices-eth0.device doesn't exist, the service can't start successfully
I don't know why these two lines are there by default
gonny95
 
Posts: 5
Joined: Tue Mar 31, 2015 1:26 am

Re: Can't assign static ip automatically on boot

Postby WarheadsSE » Tue Mar 31, 2015 1:01 pm

Because generally, those are the device names that come up. What device is this on? Those should be presenting themselves ...
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Can't assign static ip automatically on boot

Postby gonny95 » Sat Apr 04, 2015 11:22 am

Sorry for late reply

When I typed systemctl --type device --all
this is the only output:
$this->bbcode_second_pass_code('', 'UNIT LOAD ACTIVE SUB DESCRIPTION
dev-ttyS0.device loaded inactive dead dev-ttyS0.device
')

And when I typed find / -iname *.device there is no file which ends with .device
gonny95
 
Posts: 5
Joined: Tue Mar 31, 2015 1:26 am


Return to User Questions

Who is online

Users browsing this forum: No registered users and 19 guests