Skip to content
Discussion options

You must be logged in to vote

An approach that works is using NetworkManager dispatcher scripts. I created /etc/NetworkManager/dispatcher.d/90-add-floating-ip.sh:

#!/bin/bash
if [ "$1" == "eth0" -a "$2" == "up" ]; then
  ip addr add 111.222.0.33 dev eth0
fi

Then chmod a+x /etc/NetworkManager/dispatcher.d/90-add-floating-ip.sh, reboot the node and everything is fine:

# ip a s eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 96:00:02:XX:XX:XX brd ff:ff:ff:ff:ff:ff
    altname enp1s0
    inet 128.140.XX.XX/32 scope global dynamic noprefixroute eth0
       valid_lft 86078sec preferred_lft 86078sec
    inet 111.222.0.33/32 scope global eth0
       va…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@sebastianlutter
Comment options

@sebastianlutter
Comment options

Answer selected by sebastianlutter
Comment options

You must be logged in to vote
1 reply
@mysticaltech
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants