/etc/rc.d/rc.inet1.conf - bridge config overwrites first interface config
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/etc/rc.d/rc.inet1.conf - bridge config overwrites first interface config
In rc.inet1.conf, if the first interface is configured and *not* part of the bridge, and the bridge section is configured below as well, the bridge configuration overwrites the configuration for the first interface - because they use the same array index. I have spent a few hours troubleshooting when this first happened to me, as it just wasn't obvious why eth0 (in my case) remained unconfigured, although the relevant section in rc.inet1.conf was filled in. The two sections are not even next to each other in rc.inet1.conf, so you don't stand much chance of spotting the issue quickly - and all the other sample sections in rc.inet1.conf use different indexes.
I wonder if it would be possible to give the sample bridge config a different array index - maybe '5' - to follow on after the index used by the wifi config - or another one much higher? It would also be nice if all the sections would be arranged in ascending order of their index in the file - this way if a new section is inserted by the end user - it is much easier to spot if duplicate index entries are created. Just to make it less likely for others to fall in the same trap I did. Or maybe use a separate array for bridge interfaces?
the interfaces (eth0, eth1,...) are associated to different NICs on your machine if no bridge is running. When you are operating a bridge, an interface will be associated with that bridge and if your card is added to the bridge, it cannot be used for Internet protocol traffic anymore. There is a step in setting up of a bridge where there is zeroing of IP addresses associated with the NICs before reconfiguring them inside the bridge. This is why the bridge settings on a single machine in /etc/rc.d/rc.inet1.conf supersedes the eth0 settings above it.
@aragorn2101 - as per my original post, I am referring to the case where a bridge is configured, but eth0 is *not* part of the bridge (the bridge can contain other interfaces on the machine, such as eth1 or tap0). Unless I'm missing something, in this case, eth0 should not be affected by the bridge configuration, its IP address should not be zeroed and its configuration should not be superseded by the bridge configuration.
@aragorn2101 - as per my original post, I am referring to the case where a bridge is configured, but eth0 is *not* part of the bridge (the bridge can contain other interfaces on the machine, such as eth1 or tap0). Unless I'm missing something, in this case, eth0 should not be affected by the bridge configuration, its IP address should not be zeroed and its configuration should not be superseded by the bridge configuration.
Ah ok. Sorry for the confusion.
According to Slackware's /etc/rc.d/rc.inet1.conf, it seems that if you have a bridge, then eth0 would be reserved for the bridge. Then, let's say previously you had 3 cards: eth0, eth1 and eth2, you simply shift the ifnames. You change the cards to eth1, eth2 and eth3 respectively, and you change the udev rules in /etc/udev/rules.d/...net.rules for everything to work.
Make a backup of the udev rules before modifying anything.
Where? My rc.inet1.conf doesn't contain any comments or hints to that effect. Besides, are you suggesting having to change udev rules just to configure a bridge without eth0? Really? It seems like a long way around - instead of just giving the bridge config section in rc.inet1.conf a different, unused index number - which just works.
Not to mention the effort put into troubleshooting when eth0 config doesn't work in the first place, and it isn't obvious why.
In rc.inet1.conf, if the first interface is configured and *not* part of the bridge, and the bridge section is configured below as well, the bridge configuration overwrites the configuration for the first interface - because they use the same array index.
Yes, if you use defaults.
Quote:
Originally Posted by xj25vm
and all the other sample sections in rc.inet1.conf use different indexes.
Indeed.
Quote:
Originally Posted by xj25vm
I wonder if it would be possible to give the sample bridge config a different array index - maybe '5' - to follow on after the index used by the wifi config - or another one much higher?
That would be best.
If bridge sample config used index 5 it wouldn't cause problems when using defaults.
Safe defaults are important.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.