<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ansible-distro-configure.git/roles/gateway/README.md, branch main</title>
<subtitle>Ansible Roles to configure different (linux) distros
</subtitle>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/'/>
<entry>
<title>Disable ipv6 completely and remove related code</title>
<updated>2026-07-22T22:42:43+00:00</updated>
<author>
<name>Ahmed Abdelhalim</name>
<email>pm@a14m.dev</email>
</author>
<published>2026-07-22T22:42:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/commit/?id=ff4eb129eea3f3743f82e5f1f7858d43625dba3d'/>
<id>ff4eb129eea3f3743f82e5f1f7858d43625dba3d</id>
<content type='text'>
Co-Authored-By: Claude.ai
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-Authored-By: Claude.ai
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix IPv6 first-request failure caused by ICMPv6 Redirects</title>
<updated>2026-07-09T20:57:11+00:00</updated>
<author>
<name>Ahmed Abdelhalim</name>
<email>pm@a14m.dev</email>
</author>
<published>2026-07-09T20:57:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/commit/?id=1cbb9df950175e698e1edc87953e8f4bfb22b88a'/>
<id>1cbb9df950175e698e1edc87953e8f4bfb22b88a</id>
<content type='text'>
Root cause: Pi, the ISP router (FritzBox), and LAN clients share the same
L2 segment. When Pi forwards a client's IPv6 packet to an external GUA
destination, the Linux kernel detects that the ISP router is a "better"
next-hop on the same link and sends an ICMPv6 Redirect (type 137) to the
client. The client obeys the redirect and sends its first SYN to the ISP
router directly — Pi never forwards the original packet. The ISP router
applies per-device content filtering to the unmasqueraded client GUA and
issues a RST. This produced the symptom of the first IPv6 request failing
with "Connection reset by peer" every ~30-60 seconds (matching the FritzBox
RA interval, after which clients re-resolve their default gateway).

Diagnosis method: tcpdump with MAC addresses (-e flag) on Pi's end0 caught
the ICMPv6 Redirect being sent immediately after the first SYN arrived.
Inserting a DROP rule for icmpv6-type redirect at position 1 in ip6tables
OUTPUT confirmed the fix — 0 failures across extended testing.

Fix:
- Drop ICMPv6 Redirect (type 137) in ip6tables OUTPUT as the first rule,
  before the ACCEPT rule, in both direct and VPN modes
- Flush ip6tables OUTPUT chain on clear_rules() instead of per-rule -D
  deletion, which was fragile and left stale rules accumulating across
  mode switches (previously caused duplicate/conflicting OUTPUT rules)
- Flush ip6tables nat POSTROUTING table instead of per-rule -D deletion
  for the same reason

Also documents the ICMPv6 Redirect issue and IPv6 masquerade rationale
in roles/gateway/README.md for future reference.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Root cause: Pi, the ISP router (FritzBox), and LAN clients share the same
L2 segment. When Pi forwards a client's IPv6 packet to an external GUA
destination, the Linux kernel detects that the ISP router is a "better"
next-hop on the same link and sends an ICMPv6 Redirect (type 137) to the
client. The client obeys the redirect and sends its first SYN to the ISP
router directly — Pi never forwards the original packet. The ISP router
applies per-device content filtering to the unmasqueraded client GUA and
issues a RST. This produced the symptom of the first IPv6 request failing
with "Connection reset by peer" every ~30-60 seconds (matching the FritzBox
RA interval, after which clients re-resolve their default gateway).

Diagnosis method: tcpdump with MAC addresses (-e flag) on Pi's end0 caught
the ICMPv6 Redirect being sent immediately after the first SYN arrived.
Inserting a DROP rule for icmpv6-type redirect at position 1 in ip6tables
OUTPUT confirmed the fix — 0 failures across extended testing.

Fix:
- Drop ICMPv6 Redirect (type 137) in ip6tables OUTPUT as the first rule,
  before the ACCEPT rule, in both direct and VPN modes
- Flush ip6tables OUTPUT chain on clear_rules() instead of per-rule -D
  deletion, which was fragile and left stale rules accumulating across
  mode switches (previously caused duplicate/conflicting OUTPUT rules)
- Flush ip6tables nat POSTROUTING table instead of per-rule -D deletion
  for the same reason

Also documents the ICMPv6 Redirect issue and IPv6 masquerade rationale
in roles/gateway/README.md for future reference.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Route IPv6 through WireGuard VPN via radvd and static gateway</title>
<updated>2026-07-08T14:55:30+00:00</updated>
<author>
<name>Ahmed Abdelhalim</name>
<email>pm@a14m.dev</email>
</author>
<published>2026-07-08T12:28:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/commit/?id=b8f25e9d80c96f7170d51eb5abcd662a66d55317'/>
<id>b8f25e9d80c96f7170d51eb5abcd662a66d55317</id>
<content type='text'>
Add radvd to gateway role to advertise Pi as high-preference IPv6
default router using the stable ULA prefix (fd1e:.../64). With
FritzBox also sending RAs, devices end up with ECMP between Pi and
FritzBox. To solve this, add network_ipv6_gateway (Pi's link-local)
as a static route with metric 100 to all managed hosts — beats RA
metric 425, ensuring all IPv6 default traffic goes through Pi.

Fix IPv6 MASQUERADE in gateway-apply-rules:
- Direct mode: add MASQUERADE on end0 (LAN devices use ULA source
  addresses not known to FritzBox, so Pi must NAT them)
- FORWARD rules: restrict to RELATED,ESTABLISHED only — previously
  the broad ACCEPT rule passed un-NAT'd packets alongside masqueraded
  copies, causing duplicate SYNs, conntrack corruption, and RSTs
- MASQUERADE/clear rules: match by interface not by source subnet
  (devices may use any source address, not just the ULA prefix)
- VPN mode return traffic: explicitly restrict to wg+→end0 direction

Add network_ipv6_gateway var (optional) to network role NM templates
(ethernet, wifi, bridge) — injects a static IPv6 default route at
metric 100 when set. Add rpi5 static route to FritzBox link-local so
Pi keeps IPv6 after FritzBox RA is disabled.

Force SSH to IPv4 for *.local hosts (AddressFamily inet) — prevents
Ansible from hanging on mDNS returning multiple IPv6 addresses.

Update gateway and pihole READMEs with two-step IPv6 setup process.

Co-Authored-By: Claude.ai
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add radvd to gateway role to advertise Pi as high-preference IPv6
default router using the stable ULA prefix (fd1e:.../64). With
FritzBox also sending RAs, devices end up with ECMP between Pi and
FritzBox. To solve this, add network_ipv6_gateway (Pi's link-local)
as a static route with metric 100 to all managed hosts — beats RA
metric 425, ensuring all IPv6 default traffic goes through Pi.

Fix IPv6 MASQUERADE in gateway-apply-rules:
- Direct mode: add MASQUERADE on end0 (LAN devices use ULA source
  addresses not known to FritzBox, so Pi must NAT them)
- FORWARD rules: restrict to RELATED,ESTABLISHED only — previously
  the broad ACCEPT rule passed un-NAT'd packets alongside masqueraded
  copies, causing duplicate SYNs, conntrack corruption, and RSTs
- MASQUERADE/clear rules: match by interface not by source subnet
  (devices may use any source address, not just the ULA prefix)
- VPN mode return traffic: explicitly restrict to wg+→end0 direction

Add network_ipv6_gateway var (optional) to network role NM templates
(ethernet, wifi, bridge) — injects a static IPv6 default route at
metric 100 when set. Add rpi5 static route to FritzBox link-local so
Pi keeps IPv6 after FritzBox RA is disabled.

Force SSH to IPv4 for *.local hosts (AddressFamily inet) — prevents
Ansible from hanging on mDNS returning multiple IPv6 addresses.

Update gateway and pihole READMEs with two-step IPv6 setup process.

Co-Authored-By: Claude.ai
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert 524d62e changes on gateway role</title>
<updated>2026-07-07T23:20:23+00:00</updated>
<author>
<name>Ahmed Abdelhalim</name>
<email>pm@a14m.dev</email>
</author>
<published>2026-07-07T23:20:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/commit/?id=bf24bfa9368f496361dcebb6e26138358d4b4ddf'/>
<id>bf24bfa9368f496361dcebb6e26138358d4b4ddf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Attempt to enable ipv6 on the network but doesn't work stable enough</title>
<updated>2026-07-03T11:20:29+00:00</updated>
<author>
<name>Ahmed Abdelhalim</name>
<email>pm@a14m.dev</email>
</author>
<published>2026-07-03T11:20:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/commit/?id=524d62e39f58896e1ecce1c87b12fc820ef274ad'/>
<id>524d62e39f58896e1ecce1c87b12fc820ef274ad</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update the README for gateway and pihole setup with details about ipv6</title>
<updated>2026-07-01T10:21:48+00:00</updated>
<author>
<name>Ahmed Abdelhalim</name>
<email>pm@a14m.dev</email>
</author>
<published>2026-07-01T10:21:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/commit/?id=90f8483dbbfa422eced5076ae13ca3299c256676'/>
<id>90f8483dbbfa422eced5076ae13ca3299c256676</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix the testing of gateway role in containers/CI</title>
<updated>2025-09-12T15:17:30+00:00</updated>
<author>
<name>Ahmed Abdelhalim</name>
<email>pm@a14m.dev</email>
</author>
<published>2025-09-12T15:17:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/commit/?id=e40a63f465bf2ad045afd054b7a27ffe8eed5296'/>
<id>e40a63f465bf2ad045afd054b7a27ffe8eed5296</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement the gateway role (replacing old wireguard-gateway)</title>
<updated>2025-09-11T22:17:35+00:00</updated>
<author>
<name>Ahmed Abdelhalim</name>
<email>pm@a14m.dev</email>
</author>
<published>2025-09-11T22:17:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/commit/?id=4a812a999a79dae501db62e0eeb9e33e34282b83'/>
<id>4a812a999a79dae501db62e0eeb9e33e34282b83</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Refactor: rename wireguard_gateway to gateway"</title>
<updated>2025-09-03T01:46:34+00:00</updated>
<author>
<name>Ahmed Abdelhalim</name>
<email>pm@a14m.dev</email>
</author>
<published>2025-09-03T01:46:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/commit/?id=ec12de4bc29476f7733a2e5abec91687ee8985ad'/>
<id>ec12de4bc29476f7733a2e5abec91687ee8985ad</id>
<content type='text'>
This reverts commit fdd0b5b58f0ebd39ad05e2dcb17faa6603145f97.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit fdd0b5b58f0ebd39ad05e2dcb17faa6603145f97.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor: rename wireguard_gateway to gateway</title>
<updated>2025-09-03T01:26:09+00:00</updated>
<author>
<name>Ahmed Abdelhalim</name>
<email>pm@a14m.dev</email>
</author>
<published>2025-09-03T00:26:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.a14m.dev/ansible-distro-configure.git/commit/?id=7221496f0555bbdd1601ea70da2a9ca99cd34488'/>
<id>7221496f0555bbdd1601ea70da2a9ca99cd34488</id>
<content type='text'>
As the role now functions as a gateway and not just a wireguard gateway
it's better name for clarity
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As the role now functions as a gateway and not just a wireguard gateway
it's better name for clarity
</pre>
</div>
</content>
</entry>
</feed>
