Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 502326 - netifrc: no way to reconfigure a network device without restarting it
Summary: netifrc: no way to reconfigure a network device without restarting it
Status: IN_PROGRESS
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: netifrc (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: netifrc Team
URL:
Whiteboard: netifrc:bridge
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-24 12:21 UTC by Robert Bridge
Modified: 2016-10-24 19:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Bridge 2014-02-24 12:21:06 UTC
I have a VM host using bridged networking which is working excellently in the most part. Recently I had to renumber the network for the host and due to the importance of having the network configuration I would prefer to do this by editing /etc/conf.d/net and prompting the system to re-read the network config.

What I observed was that restarting net.br0 to re-read the IP config (and confirm the files as correct) caused the host to restart libvirtd and the entire bridge. In this case it was not an issue, but I can see that this would be an issue with a production system as restarting VMs to renumber the hosts interface on the network bridge is a bit extreme.

I appreciate this is probably a case of WAD but I believe it would be useful to have a way to reread a network device configuration without completely restarting the device in the case of VM hosts.

Reproducible: Always
Comment 1 William Hubbs gentoo-dev 2014-02-25 02:00:16 UTC
Did you try to restart net.br0 with the --nodeps option?
That should take the device down and bring it back up without stopping/starting the dependencies.
Comment 2 William Hubbs gentoo-dev 2014-07-09 21:51:01 UTC
Guys,

there has been no response on this bug since February, but I'm
assigning it to you in case you want to pursue it.

My reading of the problem description is that he wants to be able to
reconfigure a network device without restarting it.

Unless you know something I don't, there is not a way to do this.
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2014-07-09 21:59:53 UTC
I think we're still waiting to see what the response is regarding --nodeps ...
Comment 4 Robert Bridge 2016-03-19 13:20:45 UTC
I have just carried out the restart with --nodeps. It no longer restarts any service depending on the bridge.

However, it still tears down the bridge, which would be very disruptive to guests using that bridge. It should be possible to re-IP the host on the bridge without restarting the bridge. It certainly is possible to do this manually.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-03-19 17:03:44 UTC
(In reply to Robert Bridge from comment #4)
> I have just carried out the restart with --nodeps. It no longer restarts any
> service depending on the bridge.
> 
> However, it still tears down the bridge, which would be very disruptive to
> guests using that bridge. It should be possible to re-IP the host on the
> bridge without restarting the bridge. It certainly is possible to do this
> manually.
As far as I know, all the other distros would tear-down & recreate the bridge in this case as well.

You're after just restarting the layer 3 portion of the device config; without affecting layer 2.

Might I suggest taking a different approach to your problem?

Don't put any IP directly on the bridge; instead, attach some virtual device, and configure that with your host IP instead.
I tested it quickly with an OVS bridge and veth:
# ip link add name veth-bridge type veth peer name veth-host
# ovs-vsctl add-port br-lan veth-bridge
# ... set IP on veth-host

I'll work up a netifrc example for this to ship in the documentation.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-03-19 17:11:28 UTC
(In reply to Robin Johnson from comment #5)
> Might I suggest taking a different approach to your problem?
Another variation, perhaps easier:
ip link add name peth0 link br0 type macvlan

which should be this in netifrc (untested, just doing it quickly):
===
macvlan_macvlan0=br0
mode_macvlan0=private # optional, this is the default, might have to change it to bridge depending on your config needs
config_macvlan0="..."
===