{"id":1721,"date":"2026-03-30T16:07:36","date_gmt":"2026-03-30T14:07:36","guid":{"rendered":"https:\/\/www.shukko.com\/x3\/?p=1721"},"modified":"2026-03-30T16:07:36","modified_gmt":"2026-03-30T14:07:36","slug":"proxmox-assign-ipv4-and-ipv6-to-vms","status":"publish","type":"post","link":"https:\/\/www.shukko.com\/x3\/2026\/03\/30\/proxmox-assign-ipv4-and-ipv6-to-vms\/","title":{"rendered":"proxmox &#8211; assign ipv4 and ipv6 to vm&#8217;s"},"content":{"rendered":"\n<p>hani llm yoktu? varmi? cok ayip&#8230;. cok&#8230;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Step 1 \u2014 Configure \/etc\/network\/interfaces on the Proxmox host\nbash# \/etc\/network\/interfaces\n\nauto lo\niface lo inet loopback\n\n# Physical NIC\nauto eth0\niface eth0 inet manual\n\n# vmbr0 \u2014 uplink bridge (real IPv4 + IPv6 from ISP)\nauto vmbr0\niface vmbr0 inet static\n    address 203.0.113.1\/24        # your real IPv4\n    gateway 203.0.113.254\n    bridge-ports eth0\n    bridge-stp off\n    bridge-fd 0\n\niface vmbr0 inet6 static\n    address 2a01:xxxx:xxxx:xxxx::1\/64   # your real \/64 prefix, host address\n    gateway fe80::1                      # ISP's link-local gateway\n\n# vmbr1 \u2014 internal NAT bridge (no physical port)\nauto vmbr1\niface vmbr1 inet static\n    address 192.168.100.1\/24\n    bridge-ports none\n    bridge-stp off\n    bridge-fd 0\n    post-up   echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward\n    post-up   iptables -t nat -A POSTROUTING -s 192.168.100.0\/24 -o vmbr0 -j MASQUERADE\n    post-down iptables -t nat -D POSTROUTING -s 192.168.100.0\/24 -o vmbr0 -j MASQUERADE\nApply with:\nbashsystemctl restart networking\n# or\nifreload -a\n\nStep 2 \u2014 IPv4 DHCP for VMs via dnsmasq\nInstall and configure dnsmasq to hand out 192.168.100.x leases on vmbr1:\nbashapt install dnsmasq\nini# \/etc\/dnsmasq.d\/vmbr1.conf\n\ninterface=vmbr1\nbind-interfaces\n\n# IPv4 DHCP pool\ndhcp-range=192.168.100.50,192.168.100.200,255.255.255.0,24h\n\n# DNS\ndhcp-option=6,1.1.1.1,8.8.8.8\n\n# Optional: assign fixed IPs by MAC\n# dhcp-host=aa:bb:cc:dd:ee:ff,192.168.100.10,myhostname\nbashsystemctl enable --now dnsmasq\nsystemctl restart dnsmasq\n\nStep 3 \u2014 Real IPv6 for VMs via SLAAC (Router Advertisements)\nYour host has a real \/64, so VMs can get real public IPv6 addresses automatically via SLAAC \u2014 no DHCPv6 needed (though you can add it).\nEnable IPv6 forwarding and RA on vmbr0:\nbash# \/etc\/sysctl.d\/99-ipv6-forward.conf\nnet.ipv6.conf.all.forwarding = 1\nnet.ipv6.conf.vmbr0.accept_ra = 2   # accept RA even when forwarding\nbashsysctl -p \/etc\/sysctl.d\/99-ipv6-forward.conf\nInstall radvd to send Router Advertisements to VMs:\nbashapt install radvd\nconf# \/etc\/radvd.conf\n\ninterface vmbr0 {\n    AdvSendAdvert on;\n    MinRtrAdvInterval 30;\n    MaxRtrAdvInterval 100;\n\n    prefix 2a01:xxxx:xxxx:xxxx::\/64 {\n        AdvOnLink on;\n        AdvAutonomous on;       # enables SLAAC \u2014 VMs self-configure an IPv6\n        AdvRouterAddr on;\n    };\n};\nbashsystemctl enable --now radvd\nEach VM with SLAAC support (all modern Linux, Windows, BSD) will auto-generate a 2a01:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx address from its MAC.\n\nStep 4 \u2014 VM network config in Proxmox\nWhen creating a VM, attach two network interfaces:\nInterfaceBridgePurposenet0vmbr0Real IPv6 via SLAACnet1vmbr1Private IPv4 via DHCP (192.168.100.x)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>hani llm yoktu? varmi? cok ayip&#8230;. cok&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1721","post","type-post","status-publish","format-standard","hentry","category-kategerisiz"],"_links":{"self":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/comments?post=1721"}],"version-history":[{"count":1,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1721\/revisions"}],"predecessor-version":[{"id":1722,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1721\/revisions\/1722"}],"wp:attachment":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/media?parent=1721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/categories?post=1721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/tags?post=1721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}