Building an image to enable ip forwarding


I’ve been searching but I didn’t find anything of what i’m expecting.

I’d like to build an image to flash an FX30. This image would have all the config set to enable ip forwarding + custom iptables.rules + networks interface configured.
Currently its is done via the system command for each unit we need. So, is there a way to modify the default firmware image to add those change or do i need to rebuild a Yocto image.



Hi @vchartier,
There’s a few ways you can do what you need. There are pros and cons of each. In no particular order:

  1. You’re correct, you can build a yocto image with your rules and network cfg built-in. This is good because your cfg is part of the system and can’t be lost. However, there is a learning curve to understand dev in the yocto environment.
  2. You can create a Legato application. There’s another couple of ways to do what you want via the app. The app could make sys calls to do the configuration directly, or the app could run a shell script at startup. Depending on how you implement the app, there are further pros and cons. A standalone Legato app is at risk of Legato rollback, whereas an app built-in to the yocto environment is permanent in your image. However, if your app does have startup issues, it’s still subject to the supervisor.
  3. You can manually edit /etc/iptables.rules and /etc/network/interfaces and then “install” them onto your target device using scp and then reboot. This is probably the simplest method and very little learning curve, but also the least elegant. Your edits are also at risk of being lost if a factory reset occurs, or an EFS recovery.