1

I have several multipass instances running in an Ubuntu 18 environment. These are webservers for development and should be accessible in my local network. To allow connections from other computers on the network I used iptables to change the default FORWARD rule

ACCEPT     all  --  anywhere             10.54.188.0/24       ctstate RELATED,ESTABLISHED

to

ACCEPT     all  --  anywhere             10.54.188.0/24

That allows all incoming connections to be routed to the multipass instances. The problem came up the other day, when it appears multipass daemon restarted and overwrote my modified iptables rule (2nd rule above) with the default rule (top rule above).

How can I modify the multipass default iptables rules so any time the daemon reloads, or on a server restart I don't have to manually update the iptables rules again?

1 Answers1

0

To follow up in case anyone else is dealing with the same needs. Those rules seem to be hard coded in the Multipass source (firewall_config.cpp), and I didn't want to have to worry about that change when applying updates, so my solution was to create a script that updates the specific IPTables rule and schedule it with cron. It's not a perfect solution, but it's effective enough to keep my dev environment running.