How to assign different IP address to snap?

How do I change the IP address of a snap so that it’s different from the host IP address?

Snaps aren’t VMs or docker containers. They’re binaries running on the host, just like debs, or self-compiled binaries. So you should treat them as such. How would you run any other random binary with a different IP than the host has?

(Answer, I don’t think this is as straightforward as you might hope)

1 Like

How do I change the IP address of a snap so that it’s different from the host IP address?

Do you have multiple IP addresses on your host in the first place? Changing the source IP address for an application may require configuration of the application-itself/route table/firewall/network namespace/VPN/…etc, which is not a trivial task and is not a supported feature of the container runtimes(e.g. Flatpak, Snaps), you’ll have to figure them out on your own.

That is interesting. Actually yes, the host has 2 NICs which could work.