View previous topic :: View next topic |
Author |
Message |
transpetaflops Apprentice
Joined: 16 May 2005 Posts: 159
|
Posted: Thu Apr 18, 2024 12:18 am Post subject: Can netifrc configure the interface flags somehow? |
|
|
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 |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1847
|
Posted: Thu Apr 18, 2024 1:07 am Post subject: |
|
|
in conf.d/net:
Code: | postup() {
[ "${IFACE}" = "dummy0" ] && ip link dev dummy0 set arp on
} |
|
|
Back to top |
|
|
transpetaflops Apprentice
Joined: 16 May 2005 Posts: 159
|
Posted: Thu Apr 18, 2024 8:30 pm Post subject: |
|
|
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 |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22447
|
Posted: Thu Apr 18, 2024 8:41 pm Post subject: |
|
|
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 |
|
|
|