Hi all,
The Problem
My http(s) server is not responding to IPv6 requests from
Curl logs:
The Setup
There are now a bunch of questions to me:
Regards,
Martin
The Problem
My http(s) server is not responding to IPv6 requests from
curl -v -L -6 my devpunx.com
Curl logs:
Bash:
* Trying 2a03:b0c0:3:d0::1012:6001:80...
* Immediate connect fail for 2a03:b0c0:3:d0::1012:6001: Connection refused
* Closing connection 0
The Setup
- Host: FreeBSD 13.0-RELEASE
- BastilleBSD
- 2 jails: haproxy and nginx (IPv4 only, IPv6 not configured)
- Host has one IPv4 and one IPv6 Address
- Network Firewall (digitalocean) lets pass all IPv4 and IPv6 on :80 and :443
- Host uses NAT to the jails
- Minimalistic pf config on Host
Bash:
ext_if = "vtnet0" set block-policy return scrub in on $ext_if all fragment reassemble set skip on lo table <jails> persist nat on $ext_if from <jails> to any -> ($ext_if:0) rdr-anchor "rdr/*" block all pass proto ipv6-icmp all pass out quick keep state antispoof for $ext_if inet antispoof for $ext_if inet6 pass in inet proto tcp from any to any port { 22 } flags S/SA modulate state
- haproxy jail has rdr set for
- host:80 => haproxy_jail:80
- host:443 => haproxy_jail:80
- haproxy balances traffic to nginx jail
- Setup is working perfectly on IPv4
- IPv6 Request hits the Network-Firewall and is passing through (I also enabled icmp)
- IPv6 Request hits the Hosts pf, as all incoming :80 and :443 are redirected to the haproxy jail, I would assume, the rdr of the jail also forwards IPv6 as it does with IPv4 addresses and thus, the IPv6 request hits haproxy (?)
- haproxy binds all :80 v4v6 addresses and routes them to the "internal" nginx server via its local 192.168.0.0/16 IPv4 address
- ... and should resolve....
There are now a bunch of questions to me:
- What did I wrong or missed in this setup
- Does this setup even make sense ?
- I cite this entry: https://forums.freebsd.org/threads/...ocal-address-usage-for-nat.67531/#post-400886
"The whole idea of IPv6 is to be able to connect everything without having to resort to silly constructs like NAT." - But I like the idea to have the jails communicate internally in the private network and are somehow in a separate space (also I only have only one public IPv6 address - maybe more, but I am happy that I understood IPv4 partially :/)
- I cite this entry: https://forums.freebsd.org/threads/...ocal-address-usage-for-nat.67531/#post-400886
- How can I debug where the IPv6 request is blocked?
Regards,
Martin