Score:0

systemd-nspawn and firewall

uz flag

I have a systemd-nspawn container configured with systemd-networkd, DHCPServer=yes and IPMasquerade=yes

For replication I've opened a mysql port in /etc/systemd/nspawn/machine.nspanw

[Network] Port=tcp:33101:3306 VirtualEthernet=yes

But I don't want to open this port for everybody, only from replication server ip. So I've installed a firewall.

The simplest firewall is UFW, so:

apt install ufw ufw default deny incoming ufw default allow outgoing ufw allow from replica

But the machine connection is broken

So i've tested with a small iptables script, and it works ok, but when the systemd DHCP refresh the ip, it purge the iptables rules, and the machine connection is lost

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.