<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/rss/stylesheet/" type="text/xsl"?>
<rss xmlns:content='http://purl.org/rss/1.0/modules/content/' xmlns:taxo='http://purl.org/rss/1.0/modules/taxonomy/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:itunes='http://www.itunes.com/dtds/podcast-1.0.dtd' xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0" xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:atom='http://www.w3.org/2005/Atom' xmlns:podbridge='http://www.podbridge.com/podbridge-ad.dtd' version='2.0'>
<channel>
  <title>Snicoe&apos;s Blog</title>
  <language>zh-cn</language>
  <generator>microfeed.org</generator>
  <itunes:type>serial</itunes:type>
  <itunes:explicit>false</itunes:explicit>
  <atom:link rel="self" href="https://blog-arklink-org.pages.dev/rss/" type="application/rss+xml"/>
  <link>https://blog.arklink.org</link>
  <description>
    <![CDATA[<blockquote><em><u>“这是一步死棋”</u></em></blockquote><p>这里是Snicoe自言自语的地方，随便写点东西，也没啥人看，所以看心情更新一些陈芝麻烂谷子的东西。</p><p>计划有变，我可能不会经常维护此站点，也许可能永久不更新消失在汪洋互联网之中，会回来吗？也许吧，Good Luck！</p><p>社媒: <a href="https://www.instagram.com/snicoe0716" rel="noopener noreferrer" target="_blank">Instagram</a> | <a href="https://www.youtube.com/@snicoeofficial" rel="noopener noreferrer" target="_blank">Youtube</a> | <a href="https://x.com/snicoeofficial" rel="noopener noreferrer" target="_blank">X / Twitter</a></p><p>如果你使用了我的部分服务可以前往<a href="https://status0.arklink.org" rel="noopener noreferrer" target="_blank">Status</a>页面查看可用状态，全部服务均优先运行在IPv6网络。</p><p>本人生理男性并自认为男性，性取向正常，社恐一个，看心情回复❤️。</p>]]>
  </description>
  <itunes:author>Snicoeの自言自语</itunes:author>
  <itunes:image href="https://media-cdn.arklink.org/blog-arklink-org/production/images/channel-35018318ef9161a58e1728b4144ab0a9.png"/>
  <image>
    <title>Snicoe&apos;s Blog</title>
    <url>https://media-cdn.arklink.org/blog-arklink-org/production/images/channel-35018318ef9161a58e1728b4144ab0a9.png</url>
    <link>https://blog.arklink.org</link>
  </image>
  <copyright>©2019-2025</copyright>
  <itunes:category text="Science"/>
  <item>
    <title>让Docker容器使用SLAAC配置IPv6</title>
    <guid>wRlVmkz4M6K</guid>
    <pubDate>Thu, 05 Feb 2026 13:11:25 GMT</pubDate>
    <itunes:explicit>false</itunes:explicit>
    <description>
      <![CDATA[<p>最近在把家里网络全部拆了重来，把流量划分到完全不同VLAN里面这样我就知道什么设备什么业务在疯狂占用我的带宽，以防止被PCDN</p><p><img src="https://media-cdn.arklink.org/blog-arklink-org/production/media/rich-editor/items/wRlVmkz4M6K/image-4d797df84f896d47a530ac00c03389f6.png" width="429" height="107.41274658573596" style=""></p><p>但是遇到一个问题，BT应用最好需要用IPv6以提供更好的连接能力，但是家里的IPv6地址只能通过SLAAC获取，我也不想使用Docker的Host模式，这样如果容器被干炸了，这样入侵者会横向入侵我的网络，所以需要单独在这个VLAN里面单独进行NDP，但是Docker对IPv6支持很糟糕，普通模式只能使用静态地址，但是现在有ipvlan模式，这个模式下可以让接口桥接进L2，通过SLAAC自动配置容器IPv6地址。</p><p><br></p><p>先创建一个ipvlan网络</p><pre class="ql-syntax" spellcheck="false">docker network create -d ipvlan &nbsp;--subnet=10.103.0.0/24 \ 
--ip-range=10.103.0.48/28&nbsp;\
--gateway=10.103.0.1 \
--ipv6 \
--subnet=fd00:103::/64 \
-o parent=enp1s0.103 \
-o ipvlan_mode=l2 \
lan1_vlan_103
</pre><p>接着把容器加入到这个网络，需要添加参数让容器强制接受RA通告</p><pre class="ql-syntax" spellcheck="false">--sysctl net.ipv6.conf.all.accept_ra=2 &nbsp;
--sysctl net.ipv6.conf.eth0.accept_ra=2
</pre><p>接着测试一下，应该就没问题了</p><pre class="ql-syntax" spellcheck="false">docker exec -it uptime-kuma ping6 240e:f7:e01f:f1::30
PING 240e:f7:e01f:f1::30(240e:f7:e01f:f1::30) 56 data bytes
64 bytes from 240e:f7:e01f:f1::30: icmp_seq=2 ttl=56 time=12.0 ms
64 bytes from 240e:f7:e01f:f1::30: icmp_seq=3 ttl=56 time=11.5 ms
64 bytes from 240e:f7:e01f:f1::30: icmp_seq=4 ttl=56 time=12.9 ms
64 bytes from 240e:f7:e01f:f1::30: icmp_seq=5 ttl=56 time=11.4 ms
64 bytes from 240e:f7:e01f:f1::30: icmp_seq=6 ttl=56 time=11.7 ms
64 bytes from 240e:f7:e01f:f1::30: icmp_seq=7 ttl=56 time=11.8 ms
64 bytes from 240e:f7:e01f:f1::30: icmp_seq=8 ttl=56 time=11.8 ms
--- 240e:f7:e01f:f1::30 ping statistics ---
8 packets transmitted, 7 received, 12.5% packet loss, time 28ms
rtt min/avg/max/mdev = 11.405/11.876/12.895/0.472 ms
</pre><p>在路由器里面也能看到被分配了IPv6地址</p><pre class="ql-syntax" spellcheck="false">31 D&nbsp;240e:xxx:xxxxxx:a500:11b:f035&nbsp;&nbsp;C0:25:A5:1B:F0:35&nbsp;vlan103-bt&nbsp;main
</pre>]]>
    </description>
    <link>https://blog.arklink.org/i/dockerslaacipv6-wRlVmkz4M6K/</link>
    <itunes:episodeType>full</itunes:episodeType>
  </item>
</channel>
</rss>