diff options
author | Lars Kellogg-Stedman <lars@redhat.com> | 2014-05-23 17:14:35 -0400 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2014-05-27 08:46:30 -0700 |
commit | d40fc57de3a0b57cbf374c5fe511d550acc399ac (patch) | |
tree | f86921d46f1aa1362108c56a1b71502a32c9ba8d /rhel/etc_sysconfig_network-scripts_ifup-ovs | |
parent | f124389c9c54fbba66f3421448e1134eb5321de0 (diff) | |
download | openvswitch-d40fc57de3a0b57cbf374c5fe511d550acc399ac.tar.gz |
rhel: support persistent mac addresses on OVS bridges
This patch adds support for RHEL-derived systems (RHEL/CentOS/Fedora)
for setting the persistent MAC address of an OVS bridge via the MACADDR
setting in the interface configuration file.
Without this change, when an administrator provides MACADDR in the
interface configuration file that address will be set in ifup-eth using
the "ip link set" command. While this appears to work, any operation
that updates the OVS configuration will cause the MAC address to revert.
Persistent MAC addresses must be set using ovs-vsctl.
(Resubmitted with whitespace and grammar corrections)
Signed-off-by: Lars Kellogg-Stedman <lars@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Diffstat (limited to 'rhel/etc_sysconfig_network-scripts_ifup-ovs')
-rwxr-xr-x | rhel/etc_sysconfig_network-scripts_ifup-ovs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs index 57768c2b7..4e7d4d16d 100755 --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs @@ -85,6 +85,14 @@ case "$TYPE" in OVSBRIDGECONFIGURED="yes" fi + # If MACADDR is provided in the interface configuration file, + # we need to set it using ovs-vsctl; setting it with the "ip" + # command in ifup-eth does not make the change persistent. + if [ -n "$MACADDR" ]; then + ovs-vsctl -t ${TIMEOUT} -- set bridge "$DEVICE" \ + other-config:hwaddr="$MACADDR" + fi + # When dhcp is enabled, the assumption is that there will be a port to # attach (otherwise, we can't reach out for dhcp). So, we do not # configure the bridge through rhel's ifup infrastructure unless |