https://rancher.com/ logo
#harvester
Title
# harvester
s

stale-painting-80203

02/28/2023, 5:53 PM
Anyone know how to persist a second IP address on a given interface across harvester reboot. I tried adding the IP address to /etc/sysconfig/network/ifcfg-mgmt-br but that did not work.
b

big-judge-33880

02/28/2023, 6:10 PM
check out how /oem/99_custom.yaml sets up the bond and bridge by placing files in sysconfig/network - you could set up a bridge there to reuse the same bond or make a new one
s

stale-painting-80203

02/28/2023, 6:12 PM
I was just looking at the same based on another thread by @great-bear-19718. Thank You!
1
I don't want to break my access to the machine so just to check. Do I add a similar entry to the following with a new IP address:
Copy code
- path: /etc/sysconfig/network/ifcfg-mgmt-br
      permissions: 384
      owner: 0
      group: 0
      content: |+
        STARTMODE='onboot'
        BOOTPROTO='static'
        BRIDGE='yes'
        BRIDGE_STP='off'
        BRIDGE_FORWARDDELAY='0'
        BRIDGE_PORTS='mgmt-bo'
        PRE_UP_SCRIPT="wicked:setup_bridge.sh"
        POST_UP_SCRIPT="wicked:setup_bridge.sh"

        IPADDR=10.255.156.88
        NETMASK=255.255.255.0


        DHCLIENT_SET_DEFAULT_ROUTE='yes'


      encoding: ""
      ownerstring: ""
b

big-judge-33880

02/28/2023, 6:49 PM
yes, (with a different name for the file) - and make sure your yaml is valid and indented porperly or you’ll have the node come up plan vanilla unconfigured with default password and no network (so you’ll need to use its management to clean up your yaml)
s

stale-painting-80203

02/28/2023, 9:35 PM
I couldn't get that to work and I also need to add a rule to iptables. I am thinking if I could just run a script at bootup it might me easier. Do you know if there is a way to run a script on bootup?
b

big-judge-33880

03/02/2023, 10:24 AM
if you look at the docs for elemental-toolkit (which harvester os is based on), you’ll find you can add files like this in the oem directory that only contains your specific stuff, e.g. the following which sets a sysctl flag after the network systemd target has been reached:
Copy code
# /oem/jattin.yaml
stages:
name: "Run some customization"
stages:
  "network.after":
    - commands:
      - sysctl -w net.bridge.bridge-nf-call-ip6tables=0
👍 1
8 Views