You are not logged in.

#1 2016-06-17 04:11:06

bhrgunatha
Member
Registered: 2009-12-16
Posts: 101

[Solved] Internal static IP address and pppoe connection at boot time

I use the systemd adsl.service to bring up my DSL connection at boot time (basically using pppoe-start) which works as expected.
I only have 1 network interface and I also want to assign an internal static IP address at boot time.

I can do this after I log in using

ip address add ...

but despite plenty of wiki reading I can't work out how to simply add the address via systemd during boot.

I used to use netcfg to do that and tried using a netcl service with a static ip profile but it fails saying the interface is already up. I don't want to bring it up, just assign an IP address.
It seems like it should be trivial. I know what I want to do, just not sure how to go about it wrt to systemd.

Last edited by bhrgunatha (2016-07-21 08:27:25)

Offline

#2 2016-06-17 08:36:57

henk
Member
From: Weert, Netherlands
Registered: 2013-01-01
Posts: 334

Re: [Solved] Internal static IP address and pppoe connection at boot time

The big problem here is 'also'. You cannot have two services running for the same interface; they will rule each other out.
The interface is already up because adsl.service is running. You could disable this service and use i.e. /etc/netctl/examples/pppoe
and add the static ip parameters.

Offline

#3 2016-06-17 12:54:52

bhrgunatha
Member
Registered: 2009-12-16
Posts: 101

Re: [Solved] Internal static IP address and pppoe connection at boot time

Thanks.
I'll try adding a static addres to the pppoe service.
I'm confused why netcfg managed this but netctl can't.
Maybe it tests to see if the interface is alread up?

If that doesn't work then I guess I'll just have to add a startup script to add the address.

Offline

#4 2016-07-20 06:18:00

bhrgunatha
Member
Registered: 2009-12-16
Posts: 101

Re: [Solved] Internal static IP address and pppoe connection at boot time

I should have posted my solution earlier.
I added a one-shot systemd unit to execute the command to add the static ip address.
I'm not sure about the timing though.
It works but I think I'm just lucky that it runs after the adsl.service starts.

[Unit]
Description=set static ip address

[Service]
ExecStart=/home/bhrgunatha/bin/static-ip
Type=oneshot
User=root

[Install]
WantedBy=multi-user.target

Now everything is set up for me at boot time.

Offline

#5 2016-07-20 13:07:15

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,858
Website

Re: [Solved] Internal static IP address and pppoe connection at boot time

Please don't use "[closed]", as this denotes a locked topic. Please use "[solved]" instead.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB