<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>IPv4 on Jamie Montgomerie’s World Wide Web Log</title>
    <link>https://www.blog.montgomerie.net/tags/ipv4/</link>
    <description>Recent content in IPv4 on Jamie Montgomerie’s World Wide Web Log</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <copyright>© Jamie Montgomerie</copyright>
    <lastBuildDate>Sat, 18 Oct 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://www.blog.montgomerie.net/tags/ipv4/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Giving a rootful Podman container its own IP</title>
      <link>https://www.blog.montgomerie.net/posts/2025-10-18-giving-a-rootful-podman-container-its-own-ip/</link>
      <pubDate>Sat, 18 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://www.blog.montgomerie.net/posts/2025-10-18-giving-a-rootful-podman-container-its-own-ip/</guid>
      <description>&lt;p&gt;I went on a bit of a journey this week - moving our &lt;a href=&#34;https://pi-hole.net/&#34;&gt;Pi-hole&lt;/a&gt; from its own dedicated device&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; to a container on our home router. I still wanted it to have its own IP, and to still be able to serve DHCP and DNS. And I wanted the host machine to be able to use it. And I wanted to use &lt;a href=&#34;https://podman.io/&#34;&gt;Podman&lt;/a&gt; to host it, first because I&amp;rsquo;m using it for other things on this machine already, and second because I didn&amp;rsquo;t really want the Pi-hole machinery to have root privileges on the host (I am running Podman as root to allow it to open DNS and DHCP ports, but using UID mapping to ensure that the contents of the container are &lt;em&gt;not&lt;/em&gt; root).&lt;/p&gt;&#xA;&lt;p&gt;There are a lot of incantations out there on the Web (and, so, in AIs) for getting Podman containers to have their own IP. Most involve using &lt;code&gt;macvlan&lt;/code&gt; or &lt;a href=&#34;https://github.com/torvalds/linux/blob/master/Documentation/networking/ipvlan.rst&#34;&gt;&lt;code&gt;ipvlan&lt;/code&gt;&lt;/a&gt;. They all, though, seem to have the drawback that, while the container gets its own IP that the rest of your LAN can see, the &lt;em&gt;host&lt;/em&gt; machine can&amp;rsquo;t see it! The canonical way to fix this seems to be to set up a &amp;lsquo;shim&amp;rsquo; where your host gets a second IP, and you set up manual routing. I tried this, and it works, but, well, ick. And there are practical drawbacks to your host having two IPs - nothing that can&amp;rsquo;t be worked around&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt; but, again, ick. Also, &lt;a href=&#34;https://github.com/containers/netavark/issues/783&#34;&gt;IPv6 autoconfiguration doesn&amp;rsquo;t work&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Turns out there is actually a much cleaner way to do this - it&amp;rsquo;s just apparently not well known, and unfortunately, that it&amp;rsquo;s a good idea was &lt;a href=&#34;https://github.com/containers/common/issues/2322&#34;&gt;&amp;lsquo;hidden&amp;rsquo; by a bug&lt;/a&gt; in &lt;a href=&#34;https://github.com/containers/netavark&#34;&gt;Netavark&lt;/a&gt; (the network management infrastructure used by Podman), which didn&amp;rsquo;t let you set it up - and implied you were doing something bad.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
