Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can netifrc configure the interface flags somehow?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
transpetaflops
Apprentice
Apprentice


Joined: 16 May 2005
Posts: 159

PostPosted: Thu Apr 18, 2024 12:18 am    Post subject: Can netifrc configure the interface flags somehow? Reply with quote

I'm experimenting with a couple of dummy interfaces and the kernel creates them with the NOARP flag active. I can manually type "ifconfig dummy0 arp" to remove that flag and I can put that command in a script in /etc/local.d as a workaround. But isn't there some way to manipulate that flag in /etc/conf.d/net instead? I've scrutinized netifrc's documentation but can't find any working syntax to do this. Neither does the dummy module itself seem to have any configurable parameter to change this behavior.

/Morgan
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1667

PostPosted: Thu Apr 18, 2024 1:07 am    Post subject: Reply with quote

in conf.d/net:
Code:
postup() {
    [ "${IFACE}" = "dummy0" ] && ip link dev dummy0 set arp on
}
Back to top
View user's profile Send private message
transpetaflops
Apprentice
Apprentice


Joined: 16 May 2005
Posts: 159

PostPosted: Thu Apr 18, 2024 8:30 pm    Post subject: Reply with quote

Yes, postup() is a more convenient way than my local.d workaround, since it allows me to keep all configuration in /etc/conf.d/net. Thanks for pointing me in that direction.

Technically I was looking for some module that would allow me to manipulate the flags but I've checked the ones included in netifrc and can't find anything suitable. I'll go with postup() for now.

Btw, if I have multiple dummy interfaces and I want to perform the same action on all of them, do I have to add one line for each interface? Neither wildcards nor regex worked with the interface name in the postup() section when I tried it, but I might have done something wrong.

/Morgan
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21656

PostPosted: Thu Apr 18, 2024 8:41 pm    Post subject: Reply with quote

Using postup is also better since it ensures you get the right result even if the interface is not started at boot.

I think postup is evaluated as bash, so yes, you should be able to use standard bash text processing to recognize all dummy interfaces.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum