You are not logged in.

#1 2025-02-03 10:01:03

barbaros
Member
From: Lisbon, Portugal
Registered: 2017-02-15
Posts: 7
Website

bring ethernet interface up at boot

Hello everybody, I could use some help with the situation described below.

I have a computer with several ethernet ports. Only two of them are relevant for this post, named eno8303 and eno8403. eno8303 is linked to a slot in the wall and connects to the outside world. eno8403 is linked to a switch and provides connectivity to a local network.

At boot, here is the situation :

[root@jasminum ~]# ip address
5: eno8303: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether d0:46:0c:70:94:fe brd ff:ff:ff:ff:ff:ff
    altname enp4s0f0
    altname enxd0460c7094fe
    inet 10.101.88.16/22 brd 10.101.91.255 scope global eno8303
       valid_lft forever preferred_lft forever
    inet6 fe80::d246:cff:fe70:94fe/64 scope link proto kernel_ll
       valid_lft forever preferred_lft forever
7: eno8403: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether d0:46:0c:70:94:ff brd ff:ff:ff:ff:ff:ff
    altname enp4s0f1
    altname enxd0460c7094ff

eno8303 is up and working because I installed and enabled 'dhclient' as below

systemctl enable dhclient@eno8303

eno8403 is down. I do not need dhclient on eno8403. I prefer static addresses in the local network.

I can bring eno8403 up by entering two commands

[root@jasminum ~]# ip address add 192.168.1.1/24 broadcast + dev eno8403
[root@jasminum ~]# ip link set up dev eno8403
[root@jasminum ~]# ip address
7: eno8403: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether d0:46:0c:70:94:ff brd ff:ff:ff:ff:ff:ff
    altname enp4s0f1
    altname enxd0460c7094ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global eno8403
       valid_lft forever preferred_lft forever
    inet6 fe80::d246:cff:fe70:94ff/64 scope link tentative proto kernel_ll
       valid_lft forever preferred_lft forever

My question: which is the best way to reach this configuration after boot, without having to enter two commands manually ?

Thank you

Note: this is a follow-up of another question, ethernet interface not recognized, and will be followed by (at least) one more, about iptables and forwarding.

Last edited by barbaros (2025-02-03 10:04:49)

Offline

#2 2025-02-03 10:35:20

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 321

Re: bring ethernet interface up at boot

barbaros wrote:

My question: which is the best way to reach this configuration after boot, without having to enter two commands manually ?

One option is to use one of network managers.
Another option is to write udev rule for particular interface and run commands or script with RUN+= (i.e. write your own primitive "network manager").

Offline

#3 2025-02-03 15:58:57

cryptearth
Member
Registered: 2024-02-03
Posts: 1,257

Re: bring ethernet interface up at boot

barbaros wrote:

Note: this is a follow-up of another question, ethernet interface not recognized, and will be followed by (at least) one more, about iptables and forwarding.

https://wiki.archlinux.org/title/Router
I personal have tested and prefer the systemd way for both the external and internal interface

Offline

#4 2025-02-09 10:33:34

barbaros
Member
From: Lisbon, Portugal
Registered: 2017-02-15
Posts: 7
Website

Re: bring ethernet interface up at boot

I am learning how to write udev rules.
I learn slowly, so it will take some time.
I will keep you informed.
Thank you

Offline

Board footer

Powered by FluxBB