W dniu 6.02.2022 o 05:28, Mike Fischer pisze:
> OpenBSD 7.0 stable amf64
>
> My host has two ethernet interfaces, em0 and em1.
> Note: The host is a VM with two virtual interfaces.
>
> Both interfaces are configured like this for IPv6 in the /etc/hostname.em0 and /etc/hostname.em1 files:
> inet6 autoconf -temporary -soii
>
> They are connected to the same LAN and each produces a unique IPv6 address using the same prefix and an EUI64 interface identifier as expected*.
> $ ifconfig em0|grep inet6|grep -vE '(fe80:| fd|temporary|deprecated)'
> inet6 2001:db8::20c:29ff:fd9c:4b7 prefixlen 64 autoconf pltime 1070 vltime 7043
> $ ifconfig em1|grep inet6|grep -vE '(fe80:| fd|temporary|deprecated)'
> inet6 2001:db8::20c:29ff:fd9c:4c1 prefixlen 64 autoconf pltime 1032 vltime 7005
>
> DNS records have been set up*:
> $ dig +short a.example.com aaaa
> 2001:db8::20c:29ff:fd9c:4b7
> $ dig +short b.example.com aaaa
> 2001:db8::20c:29ff:fd9c:4c1
> $
>
> My httpd.conf looks like this*:
>
> ipa = "2001:db8::20c:29ff:fd9c:4b7"
> ipb = "2001:db8::20c:29ff:fd9c:4c1"
>
> server "a.example.com" {
> listen on $ipa port 80
> directory index index.html
> location "/*" {
> root "/htdocs/a"
> }
> }
>
> server "b.example.com" {
> listen on $ipb port 80
> directory index index.html
> location "/*" {
> root "/htdocs/b"
> }
> }
>
>
> /var/www/htdocs/a/index.html and /var/www/htdocs/b/index.html exist and each contains a minimal HTML page.
>
> httpd -n sees no problem.
>
> rcctl start httpd works fine.
>
> However trying to access http://a.example.com or http://[2001:db8::20c:29ff:fd9c:4b7] gets a timeout.
>
> Accessing http://b.example.com or http://[2001:db8::20c:29ff:fd9c:4c1] works fine.
>
>
> Trying to find the cause I checked:
> $ netstat -an|grep LISTEN
> …
> tcp6 0 0 2001:db8::.80 *.* LISTEN
> tcp6 0 0 2001:db8::.80 *.* LISTEN
> …
> $
> Which seems weird because only the prefix is listed not the complete IPv6 addresses.
>
>
> Am I seeing a bug or is my expectation that both servers (virtual hosts) work wrong?
>
>
> *) Hostnames and IPs anonymized.
>
> Thanks!
> Mike
>
"They are connected to the same LAN"
This is most likely your problem. Having two IPs on two interfaces in
the same subnet will usually cause problems. Most likely you also have
two default routes.
You can work around it by putting both interfaces in diffrent rdomains,
then running two httpd instances, one in rdomain with first IP, second
in rdomain with second IP.
Or, assign both IPs statically to em0 (one with prefix /64, second with
prefix /128), then remove em1 - I'm 99% sure this will solve your problem.
Best regards
--
Łukasz Moskała
No comments:
Post a Comment