Hi,
This is my cloud-init user-data
#cloud-config vyos_config_commands: - set nat source rule 100 outbound-interface name 'eth0' - set nat source rule 100 translation address 'masquerade'
This is the output from cloud-init.log
2024-01-03 00:15:22,454 - cc_vyos_userdata.py[DEBUG]: Configuring command: "set nat source rule 100 outbound-interface name 'eth0'" 2024-01-03 00:15:22,455 - cc_vyos_userdata.py[DEBUG]: Marking node as tag: "['nat', 'source', 'rule']" 2024-01-03 00:15:22,455 - cc_vyos_userdata.py[DEBUG]: Configuring command: "set nat source rule 100 translation address 'masquerade'" 2024-01-03 00:15:22,455 - cc_vyos_userdata.py[DEBUG]: Marking node as tag: "['nat', 'source', 'rule']" 2024-01-03 00:15:22,455 - cc_vyos_userdata.py[DEBUG]: Configuration file saved: /opt/vyatta/etc/config/config.boot 2024-01-03 00:15:22,455 - handlers.py[DEBUG]: finish: modules-config/config-vyos_userdata: SUCCESS: config-vyos_userdata ran successfully 2024-01-03 00:15:22,456 - main.py[DEBUG]: Ran 3 modules with 0 failures
However the config.boot does not process the interface name correctly and fails to load as a result. This is the relevant config created in config.boot, note it is missing the interface name.
interfaces { ethernet eth0 { address "dhcp" hw-id "fa:16:3e:33:ab:24" mtu "1500" offload { gro gso sg tso } } } nat { source { rule 100 { outbound-interface { name "" } translation { address "masquerade" } } } }
As you can see eth0 exists.
Thanks
Daniel