When I manually ping the server of the VOIP provider, ping uses an IPv6 address. I have to use 'ping -4' to get an IPv4 address. That also shows that asterisk must be asking for IPv4 and not for IPv6.
With bind running on OPNsense, it doesn't work. I have verified that when using the IP address of the server of the VOIP provider instead of the host name, it works and asterisk registers. Again the conclusion is that bind on OPNsense is incorrectly answering with an IPv6 address instead of an IPv4 address.
Quote from: defaultuserfoo on May 26, 2024, 12:42:36 amWhen I manually ping the server of the VOIP provider, ping uses an IPv6 address. I have to use 'ping -4' to get an IPv4 address. That also shows that asterisk must be asking for IPv4 and not for IPv6.No, it shows that when you advise the client (ping) to use IPv4, it will ask for the IPv4 address of its target only.
Try it yourself: If you use "nslookup <target>", you will get both adresses. Which of those are used is then up to the client (which will default to IPv6 if it is able to use it).
Quote from: defaultuserfoo on May 26, 2024, 12:42:36 amWith bind running on OPNsense, it doesn't work. I have verified that when using the IP address of the server of the VOIP provider instead of the host name, it works and asterisk registers. Again the conclusion is that bind on OPNsense is incorrectly answering with an IPv6 address instead of an IPv4 address.You are wrong. The default for DNS is to return all addresses (in no specific order) and it is up to the client to decide which it uses. That is by design, not "incorrect".
But as I said, you can restrict OpnSense or even bind itself to only use IPv4, as is probably the case with your other bind instance.
Consider this: If you want bind on OpnSense to return IPv6 adresses as well as IPv4, and you have three options:1. Ask for IPv42. Ask for IPv63. Ask for any IPand you say, you want to be able to do 2. and 3. (since you do not want to disable IPv6 altogether), what does your client have to do in order to get IPv4? See?
I would guess that your server bind installation is restricted to IPv4 only like this.
# ping ipv64.netPING ipv64.net (2a01:4f8:192:1326::bad:c0de) 56 data bytes64 bytes from ipv64.net (2a01:4f8:192:1326::bad:c0de): icmp_seq=1 ttl=57 time=12.4 ms[...]# dig ipv64.net; <<>> DiG 9.18.26 <<>> ipv64.net;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5885;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1;; OPT PSEUDOSECTION:; EDNS: version: 0, flags:; udp: 1232; COOKIE: 41379600a24aa64b010000006653753b6c1b0112247d26d9 (good);; QUESTION SECTION:;ipv64.net. IN A;; ANSWER SECTION:ipv64.net. 3446 IN A 144.76.85.238;; Query time: 0 msec;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP);; WHEN: Sun May 26 19:45:31 CEST 2024;; MSG SIZE rcvd: 82# dig -t any ipv64.net; <<>> DiG 9.18.26 <<>> -t any ipv64.net;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64751;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 5;; OPT PSEUDOSECTION:; EDNS: version: 0, flags:; udp: 1232; COOKIE: 9072464819cc397a0100000066537571f28842cc104a0ef2 (good);; QUESTION SECTION:;ipv64.net. IN ANY;; ANSWER SECTION:ipv64.net. 3143 IN SOA ns1.ipv64.net. hostmaster.ipv64.net. 4239685 10800 3600 604800 3600ipv64.net. 3520 IN AAAA 2a01:4f8:192:1326::bad:c0deipv64.net. 3392 IN A 144.76.85.238ipv64.net. 3143 IN NS ns1.ipv64.net.ipv64.net. 3143 IN NS ns2.ipv64.net.ipv64.net. 3143 IN TXT "v=spf1 mx a -all"ipv64.net. 3143 IN TXT "google-site-verification=8aQ-Dd65zb-d8CCA121kSqkuOOHHzrpxEg9f8ADm7f8"ipv64.net. 3143 IN MX 10 mail.schroederdennis.de.;; ADDITIONAL SECTION:ns1.ipv64.net. 88807 IN A 195.201.223.103ns2.ipv64.net. 88807 IN A 157.90.241.20ns1.ipv64.net. 88807 IN AAAA 2a01:4f8:c2c:559c::1ns2.ipv64.net. 88807 IN AAAA 2a01:4f8:c012:9c97::1;; Query time: 0 msec;; SERVER: 127.0.0.1#53(127.0.0.1) (TCP);; WHEN: Sun May 26 19:46:25 CEST 2024;; MSG SIZE rcvd: 430
dig -p 530 ipv64.net @192.168.3.1; <<>> DiG 9.18.26 <<>> -p 530 ipv64.net @192.168.3.1;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37648;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1;; OPT PSEUDOSECTION:; EDNS: version: 0, flags:; udp: 1232; COOKIE: 3d90bb4740ed5194010000006653763ec95d7c5786cc36bc (good);; QUESTION SECTION:;ipv64.net. IN A;; ANSWER SECTION:ipv64.net. 3600 IN A 144.76.85.238;; Query time: 55 msec;; SERVER: 192.168.3.1#530(192.168.3.1) (UDP);; WHEN: Sun May 26 19:49:50 CEST 2024;; MSG SIZE rcvd: 82dig -p 530 -t any ipv64.net @192.168.3.1; <<>> DiG 9.18.26 <<>> -p 530 -t any ipv64.net @192.168.3.1;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21078;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 5;; OPT PSEUDOSECTION:; EDNS: version: 0, flags:; udp: 1232; COOKIE: 5148bcba6202632d010000006653769e52b873e71ac13dc5 (good);; QUESTION SECTION:;ipv64.net. IN ANY;; ANSWER SECTION:ipv64.net. 3600 IN SOA ns1.ipv64.net. hostmaster.ipv64.net. 4239843 10800 3600 604800 3600ipv64.net. 3600 IN AAAA 2a01:4f8:192:1326::bad:c0deipv64.net. 3504 IN A 144.76.85.238ipv64.net. 3600 IN NS ns1.ipv64.net.ipv64.net. 3600 IN NS ns2.ipv64.net.ipv64.net. 3600 IN TXT "google-site-verification=8aQ-Dd65zb-d8CCA121kSqkuOOHHzrpxEg9f8ADm7f8"ipv64.net. 3600 IN TXT "v=spf1 mx a -all"ipv64.net. 3600 IN MX 10 mail.schroederdennis.de.;; ADDITIONAL SECTION:ns1.ipv64.net. 172704 IN A 195.201.223.103ns2.ipv64.net. 172704 IN A 157.90.241.20ns1.ipv64.net. 172704 IN AAAA 2a01:4f8:c2c:559c::1ns2.ipv64.net. 172704 IN AAAA 2a01:4f8:c012:9c97::1;; Query time: 37 msec;; SERVER: 192.168.3.1#530(192.168.3.1) (TCP);; WHEN: Sun May 26 19:51:26 CEST 2024;; MSG SIZE rcvd: 430
maybe a quick "fix" for this is to make a dnsrewrite in opnsense-bind for this particular domain pointing to ipv4?see here how this can be done in bind: https://www.redpill-linpro.com/techblog/2015/12/08/dns-rpz.html
; With the current situation, you can do one of four things:; a) Listen on a specific IPv4 address. Example: bindaddr=192.0.2.1; b) Listen on a specific IPv6 address. Example: bindaddr=2001:db8::1; c) Listen on the IPv4 wildcard. Example: bindaddr=0.0.0.0; d) Listen on the IPv4 and IPv6 wildcards. Example: bindaddr=::; (You can choose independently for UDP, TCP, and TLS, by specifying different values for; "udpbindaddr", "tcpbindaddr", and "tlsbindaddr".); (Note that using bindaddr=:: will show only a single IPv6 socket in netstat.; IPv4 is supported at the same time using IPv4-mapped IPv6 addresses.);; You may optionally add a port number. (The default is port 5060 for UDP and TCP, 5061; for TLS).; IPv4 example: bindaddr=0.0.0.0:5062; IPv6 example: bindaddr=[::]:5062;; The address family of the bound UDP address is used to determine how Asterisk performs; DNS lookups. In cases a) and c) above, only A records are considered. In case b), only; AAAA records are considered. In case d), both A and AAAA records are considered. Note,; however, that Asterisk ignores all records except the first one. In case d), when both A; and AAAA records are available, either an A or AAAA record will be first, and which one; depends on the operating system. On systems using glibc, AAAA records are given; priority.udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all) ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
[transport-tls]type=transportprotocol=tlsbind=192.168.3.50:5061ca_list_file=/etc/pki/tls/certs/ca-bundle.crtcert_file=/etc/asterisk/cert/cert.pempriv_key_file=/etc/asterisk/cert/privkey.pemmethod=tlsv1_2