-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I use "checkip.dyndns.org" to obtain my router external IP in scripts. I don't have yet IPv6, but my question is, can someone that does have IPv6 test it and find out if it writes the IPv6 address? And if not, is there an alternative query site to find that one, suitable for scripts? Thank you. - -- Cheers Carlos E. R. (from 15.4 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCY/38TRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVa4kAnjweCuxlWfZDdORk9Bl4 F7XpudX9AJ9SGHWhJiSffQlE/lGlAoYk/E7K4w== =KzjU -----END PGP SIGNATURE-----
* Carlos E. R. <robin.listas@telefonica.net> [02-28-23 10:36]:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I use "checkip.dyndns.org" to obtain my router external IP in scripts. I don't have yet IPv6, but my question is, can someone that does have IPv6 test it and find out if it writes the IPv6 address?
And if not, is there an alternative query site to find that one, suitable for scripts?
Thank you.
- -- Cheers
Carlos E. R. (from 15.4 x86_64 at Telcontar)
-----BEGIN PGP SIGNATURE-----
iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCY/38TRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVa4kAnjweCuxlWfZDdORk9Bl4 F7XpudX9AJ9SGHWhJiSffQlE/lGlAoYk/E7K4w== =KzjU -----END PGP SIGNATURE-----
curl ipconfig.org works quite well. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc
On Tue, Feb 28, 2023 at 4:56 PM Patrick Shanahan <paka@opensuse.org> wrote:
curl ipconfig.org works quite well.
that host only having an ipv4 address currently duh. why not sticking to the OPs mentioned service and check their ipv6 hostname instead
checkipv6.dyndns.org is an alias for checkipv6.dyndns.com. curl --ipv6 checkipv6.dyndns.com.
ipv6 are multiple addresses for a networking interface though and all that comes along with the whole stack and idea
Carlos E. R. wrote:
I use "checkip.dyndns.org" to obtain my router external IP in scripts. I don't have yet IPv6, but my question is, can someone that does have IPv6 test it and find out if it writes the IPv6 address?
'checkip.d.o' only has IPv4 addresses.
And if not, is there an alternative query site to find that one, suitable for scripts?
You could try http://checkip.dns24.ch http://testipv6.hostsuisse.net/ is ipv6-only and will tell you which address you are accessing from. -- Per Jessen, Zürich (-0.2°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On 2023-02-28 17:08, Per Jessen wrote:
Carlos E. R. wrote:
I use "checkip.dyndns.org" to obtain my router external IP in scripts. I don't have yet IPv6, but my question is, can someone that does have IPv6 test it and find out if it writes the IPv6 address?
'checkip.d.o' only has IPv4 addresses.
And if not, is there an alternative query site to find that one, suitable for scripts?
You could try http://checkip.dns24.ch
I can't try because I don't have IPv6 yet ;-) But noted.
http://testipv6.hostsuisse.net/ is ipv6-only and will tell you which address you are accessing from.
That one says "unable to connect". Obvious, because I don't have IPv6 yet. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
Carlos E. R. wrote:
On 2023-02-28 17:08, Per Jessen wrote:
Carlos E. R. wrote:
I use "checkip.dyndns.org" to obtain my router external IP in scripts. I don't have yet IPv6, but my question is, can someone that does have IPv6 test it and find out if it writes the IPv6 address?
'checkip.d.o' only has IPv4 addresses.
And if not, is there an alternative query site to find that one, suitable for scripts?
You could try http://checkip.dns24.ch
I can't try because I don't have IPv6 yet ;-)
It has both ipv4 and ipv6.
http://testipv6.hostsuisse.net/ is ipv6-only and will tell you which address you are accessing from.
That one says "unable to connect". Obvious, because I don't have IPv6 yet.
Yup. -- Per Jessen, Zürich (-0.7°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On 2023-02-28 20:13, Per Jessen wrote:
Carlos E. R. wrote:
On 2023-02-28 17:08, Per Jessen wrote:
Carlos E. R. wrote:
I use "checkip.dyndns.org" to obtain my router external IP in scripts. I don't have yet IPv6, but my question is, can someone that does have IPv6 test it and find out if it writes the IPv6 address?
'checkip.d.o' only has IPv4 addresses.
And if not, is there an alternative query site to find that one, suitable for scripts?
You could try http://checkip.dns24.ch
I can't try because I don't have IPv6 yet ;-)
It has both ipv4 and ipv6.
Aha, ok, thanks. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2023-02-28 a las 20:29 +0100, Carlos E. R. escribió:
On 2023-02-28 20:13, Per Jessen wrote:
Carlos E. R. wrote:
On 2023-02-28 17:08, Per Jessen wrote:
Carlos E. R. wrote:
I use "checkip.dyndns.org" to obtain my router external IP in scripts. I don't have yet IPv6, but my question is, can someone that does have IPv6 test it and find out if it writes the IPv6 address?
'checkip.d.o' only has IPv4 addresses.
And if not, is there an alternative query site to find that one, suitable for scripts?
You could try http://checkip.dns24.ch
I can't try because I don't have IPv6 yet ;-)
It has both ipv4 and ipv6.
Aha, ok, thanks.
I just did a little test (I was testing something else, so I took the chance to try these sites). I thethered my laptop to my phone (I had to insist to NM three times to do it), which gets both IPv6 and IPv4 (a 10.*.*.*). ifconfig on the laptop reports: wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.194.251 netmask 255.255.255.0 broadcast 192.168.194.255 inet6 fe80::9841:x:y:z prefixlen 64 scopeid 0x20<link> inet6 2a02:**:e1c4 prefixlen 64 scopeid 0x0<global> inet6 2a02:**:93f5 prefixlen 64 scopeid 0x0<global> Then I tried those IP reporting sites. http://checkip.dyndns.org/ 504 Gateway Time-out http://checkip.dns24.ch/ 2a02:9130:**:93f5 Interestingly, it seems the laptop doesn't get an external IPv4 address. Yet I can ssh (on IPv4) to home, and I see an IPv4 address reported (that was the test I was interested in). Minutes later, dyndns reports a 176.*.*.* address, same one as sshd sees. Ok, all good. But http://checkip.dns24.ch/ does not report both addresses. - -- Cheers Carlos E. R. (from openSUSE 15.4 (Legolas)) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCY/5nFhwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVbZ0An0o6mwAhm+0anRBTYhCS 3rJadeuBAJ47ttyVOISyx2z+dN9nLr+gYo1EpQ== =dkRD -----END PGP SIGNATURE-----
Carlos E. R. wrote:
Ok, all good. But http://checkip.dns24.ch/ does not report both addresses.
It cannot - seen from the server, a client only ever has one address. when a client (e.g. your browser) connects to http://checkip.dns24.ch/, it does a lookup (getaddrinfo) of "checkip.dns24.ch", which will return two addresses. You can check that with "host checkip.dns24.ch". Depending on your setup, your browser will attempt a connection to _one_ of those. That connection will come from a client address that is suitable for the destination. On a typical system with IPv6, it will prefer to use the IPv6 address, and the connecttion will come from an IPv6 address. -- Per Jessen, Zürich (0.7°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2023-03-01 a las 08:46 +0100, Per Jessen escribió:
Carlos E. R. wrote:
Ok, all good. But http://checkip.dns24.ch/ does not report both addresses.
It cannot - seen from the server, a client only ever has one address.
Right, I did not think of that.
when a client (e.g. your browser) connects to http://checkip.dns24.ch/, it does a lookup (getaddrinfo) of "checkip.dns24.ch", which will return two addresses. You can check that with "host checkip.dns24.ch". Depending on your setup, your browser will attempt a connection to _one_ of those. That connection will come from a client address that is suitable for the destination. On a typical system with IPv6, it will prefer to use the IPv6 address, and the connecttion will come from an IPv6 address.
Sure, it is obvious. Ok, then the "solution" would be to have two check IP sites: one that the server is on IPv4, and another where the server is on IPv6 :-) Before the ISP changed my router, I obtained my external IP doing a telnet to my router and asking. But current router does not respond to commands. Not even to "?" or "help". Looking at my old "expect" script, I see I did "wan show". Let's try that on new router... Woah, it works! :-O cer@Telcontar:~/tmp> ssh 1234@router.valinor ... Offending key for IP in /home/cer/.ssh/known_hosts:103 Are you sure you want to continue connecting (yes/no)? yes 1234@router.valinor's password: fail to read file > wan show VCC Con. Service Interface Proto. IGMP Src? MLD Src? Status IP ID Name Name address N/A 2 3 veip0.2 IPoE Disable Disable Disable Disable Connected 10.22.74.68 N/A 3 2 veip0.3 IPoE Enable Enable Disable Disable Connected 10.195.97.231 N/A 1 6 ppp0.1 PPPoE Disable Disable Disable Disable Connected 79... sshd:error:359.628:cli_wanShowServices:1533:unknown or unsupported WAN access type X_BROADCOM_COM_L2TPAC
? help quit
Bye bye. Have a nice day!!! Connection to router.valinor closed. cer@Telcontar:~/tmp> Ok, so now that I modified my script to use an external web site for checking, I can keep that, or change again to using telnet or ssh. Huh, telnet doesn't answer, although the port is open: cer@Telcontar:~/tmp> nmap router.valinor Starting Nmap 7.92 ( https://nmap.org ) at 2023-03-01 12:23 CET Nmap scan report for router.valinor (192.168.1.1) Host is up (0.031s latency). Not shown: 994 closed tcp ports (conn-refused) PORT STATE SERVICE 21/tcp filtered ftp 22/tcp open ssh 23/tcp filtered telnet 80/tcp open http 443/tcp open https 5431/tcp open park-agent Nmap done: 1 IP address (1 host up) scanned in 3.54 seconds cer@Telcontar:~/tmp> No, not open, filtered. - -- Cheers, Carlos E. R. (from openSUSE 15.4 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCY/82Ahwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVsFoAn0mTlVN8L+ZpIj5aBXzv MdpUbjhfAJ92cFX3WLrDnI8f9sBgUaMv6+5cUQ== =jc+E -----END PGP SIGNATURE-----
Carlos E. R. wrote:
when a client (e.g. your browser) connects to http://checkip.dns24.ch/, it does a lookup (getaddrinfo) of "checkip.dns24.ch", which will return two addresses. You can check that with "host checkip.dns24.ch". Depending on your setup, your browser will attempt a connection to _one_ of those. That connection will come from a client address that is suitable for the destination. On a typical system with IPv6, it will prefer to use the IPv6 address, and the connecttion will come from an IPv6 address.
Sure, it is obvious.
Ok, then the "solution" would be to have two check IP sites: one that the server is on IPv4, and another where the server is on IPv6 :-)
You can use /etc/gai.conf to set your system's preference, ipv6 over ipv4 or vice versa. You could use addresses instead of names, or you could use the two different dyndns names http://checkip.dyndns.org/ and http://checkipv6.dyndns.org/. If you're using a command line utility, it might very well have a switch for forcing ipv4 or ipv6 only. -- Per Jessen, Zürich (1.8°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On 2023-03-01 12:37, Per Jessen wrote:
Carlos E. R. wrote:
when a client (e.g. your browser) connects to http://checkip.dns24.ch/, it does a lookup (getaddrinfo) of "checkip.dns24.ch", which will return two addresses. You can check that with "host checkip.dns24.ch". Depending on your setup, your browser will attempt a connection to _one_ of those. That connection will come from a client address that is suitable for the destination. On a typical system with IPv6, it will prefer to use the IPv6 address, and the connecttion will come from an IPv6 address.
Sure, it is obvious.
Ok, then the "solution" would be to have two check IP sites: one that the server is on IPv4, and another where the server is on IPv6 :-)
You can use /etc/gai.conf to set your system's preference, ipv6 over ipv4 or vice versa.
And do that in the script that asks for my current IP in a cronjob? :-D
You could use addresses instead of names, or you could use the two different dyndns names http://checkip.dyndns.org/ and http://checkipv6.dyndns.org/.
Yes, the second method is what I suggested.
If you're using a command line utility, it might very well have a switch for forcing ipv4 or ipv6 only.
True; I am using wget. -4 --inet4-only -6 --inet6-only Added --inet4-only to script for now. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
Carlos E. R. wrote:
On 2023-03-01 12:37, Per Jessen wrote:
Carlos E. R. wrote:
when a client (e.g. your browser) connects to http://checkip.dns24.ch/, it does a lookup (getaddrinfo) of "checkip.dns24.ch", which will return two addresses. You can check that with "host checkip.dns24.ch". Depending on your setup, your browser will attempt a connection to _one_ of those. That connection will come from a client address that is suitable for the destination. On a typical system with IPv6, it will prefer to use the IPv6 address, and the connecttion will come from an IPv6 address.
Sure, it is obvious.
Ok, then the "solution" would be to have two check IP sites: one that the server is on IPv4, and another where the server is on IPv6 :-)
You can use /etc/gai.conf to set your system's preference, ipv6 over ipv4 or vice versa.
And do that in the script that asks for my current IP in a cronjob? :-D
Well, if you believe it to be necessary, why not. I don't really see which problem you are seeking a solution to, though. If you use "checkip.dns24.ch", you will get an answer that corresponds to your system's abilities and configuration.
You could use addresses instead of names, or you could use the two different dyndns names http://checkip.dyndns.org/ and http://checkipv6.dyndns.org/.
Yes, the second method is what I suggested.
The issue - in my view - is that it means more work on your side, but as I said, it depends on which problem you're trying to solve. -- Per Jessen, Zürich (2.6°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On 2023-03-01 13:04, Per Jessen wrote:
Carlos E. R. wrote:
On 2023-03-01 12:37, Per Jessen wrote:
Carlos E. R. wrote:
when a client (e.g. your browser) connects to http://checkip.dns24.ch/, it does a lookup (getaddrinfo) of "checkip.dns24.ch", which will return two addresses. You can check that with "host checkip.dns24.ch". Depending on your setup, your browser will attempt a connection to _one_ of those. That connection will come from a client address that is suitable for the destination. On a typical system with IPv6, it will prefer to use the IPv6 address, and the connecttion will come from an IPv6 address.
Sure, it is obvious.
Ok, then the "solution" would be to have two check IP sites: one that the server is on IPv4, and another where the server is on IPv6 :-)
You can use /etc/gai.conf to set your system's preference, ipv6 over ipv4 or vice versa.
And do that in the script that asks for my current IP in a cronjob? :-D
Well, if you believe it to be necessary, why not. I don't really see which problem you are seeking a solution to, though.
Simply, a cron script that logs the current IP and then updates the dynamic DNS entry.
If you use "checkip.dns24.ch", you will get an answer that corresponds to your system's abilities and configuration.
You could use addresses instead of names, or you could use the two different dyndns names http://checkip.dyndns.org/ and http://checkipv6.dyndns.org/.
Yes, the second method is what I suggested.
The issue - in my view - is that it means more work on your side, but as I said, it depends on which problem you're trying to solve.
Just obtain the IP(s), log it (them), and update dynamic dns server. I have it working for IPv4. I will need to add IPv6 soon. I do: set `wget --inet4-only --timeout=15 -qO - checkip.dyndns.org | \ cut -d":" -f2 | cut -d"<" -f1 | cut -d" " -f2` CURRENTIP="$*" For IPv6 I expect to do: wget --inet6-only --timeout=15 -qO - http://checkip.dns24.ch/ | \ cut -d":" -f2 | cut -d"<" -f1 | cut -d" " -f2 CURRENTIP6="$*" -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
Carlos E. R. wrote:
On 2023-03-01 13:04, Per Jessen wrote:
I don't really see which problem you are seeking a solution to, though.
Simply, a cron script that logs the current IP and then updates the dynamic DNS entry.
Okay.
The issue - in my view - is that it means more work on your side, but as I said, it depends on which problem you're trying to solve.
Just obtain the IP(s), log it (them), and update dynamic dns server. I have it working for IPv4. I will need to add IPv6 soon.
wget -q -4 -O - http://checkip.dns24.ch/ | <your-script> wget -q -6 -O - http://checkip.dns24.ch/ | <your-script>
I do:
set `wget --inet4-only --timeout=15 -qO - checkip.dyndns.org | \ cut -d":" -f2 | cut -d"<" -f1 | cut -d" " -f2` CURRENTIP="$*"
I would be tempted to shorten that: CURRENTIP=$(wget -4 --timeout=15 -qO - checkip.dyndns.org | \ egrep -o '[0-9.]+')
For IPv6 I expect to do:
wget --inet6-only --timeout=15 -qO - http://checkip.dns24.ch/ | \ cut -d":" -f2 | cut -d"<" -f1 | cut -d" " -f2
checkip.dns24.ch only supplies text, no html. CURRENTIP=$(wget -6 --timeout=15 -qO - checkip.dns24.ch) -- Per Jessen, Zürich (1.8°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
On 2023-03-01 14:48, Per Jessen wrote:
Carlos E. R. wrote:
On 2023-03-01 13:04, Per Jessen wrote:
I don't really see which problem you are seeking a solution to, though.
Simply, a cron script that logs the current IP and then updates the dynamic DNS entry.
Okay.
The issue - in my view - is that it means more work on your side, but as I said, it depends on which problem you're trying to solve.
Just obtain the IP(s), log it (them), and update dynamic dns server. I have it working for IPv4. I will need to add IPv6 soon.
wget -q -4 -O - http://checkip.dns24.ch/ | <your-script> wget -q -6 -O - http://checkip.dns24.ch/ | <your-script>
I do:
set `wget --inet4-only --timeout=15 -qO - checkip.dyndns.org | \ cut -d":" -f2 | cut -d"<" -f1 | cut -d" " -f2` CURRENTIP="$*"
I would be tempted to shorten that:
CURRENTIP=$(wget -4 --timeout=15 -qO - checkip.dyndns.org | \ egrep -o '[0-9.]+')
For IPv6 I expect to do:
wget --inet6-only --timeout=15 -qO - http://checkip.dns24.ch/ | \ cut -d":" -f2 | cut -d"<" -f1 | cut -d" " -f2
checkip.dns24.ch only supplies text, no html.
CURRENTIP=$(wget -6 --timeout=15 -qO - checkip.dns24.ch)
Okay :-) cer@Telcontar:~> wget -4 --timeout=15 -qO - checkip.dns24.ch 79.*.*.*cer@Telcontar:~> No end line? -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
* Carlos E. R. <robin.listas@telefonica.net> [03-01-23 16:48]:
On 2023-03-01 14:48, Per Jessen wrote:
Carlos E. R. wrote:
On 2023-03-01 13:04, Per Jessen wrote:
I don't really see which problem you are seeking a solution to, though.
Simply, a cron script that logs the current IP and then updates the dynamic DNS entry.
Okay.
The issue - in my view - is that it means more work on your side, but as I said, it depends on which problem you're trying to solve.
Just obtain the IP(s), log it (them), and update dynamic dns server. I have it working for IPv4. I will need to add IPv6 soon.
wget -q -4 -O - http://checkip.dns24.ch/ | <your-script> wget -q -6 -O - http://checkip.dns24.ch/ | <your-script>
I do:
set `wget --inet4-only --timeout=15 -qO - checkip.dyndns.org | \ cut -d":" -f2 | cut -d"<" -f1 | cut -d" " -f2` CURRENTIP="$*"
I would be tempted to shorten that:
CURRENTIP=$(wget -4 --timeout=15 -qO - checkip.dyndns.org | \ egrep -o '[0-9.]+')
For IPv6 I expect to do:
wget --inet6-only --timeout=15 -qO - http://checkip.dns24.ch/ | \ cut -d":" -f2 | cut -d"<" -f1 | cut -d" " -f2
checkip.dns24.ch only supplies text, no html.
CURRENTIP=$(wget -6 --timeout=15 -qO - checkip.dns24.ch)
Okay :-)
cer@Telcontar:~> wget -4 --timeout=15 -qO - checkip.dns24.ch 79.*.*.*cer@Telcontar:~>
No end line?
MYIP=`wget -4 --timeout=15 -qO - checkip.dns24.ch`;echo $MYIP -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc
On 2023-03-02 01:17, Patrick Shanahan wrote:
* Carlos E. R. <robin.listas@telefonica.net> [03-01-23 16:48]:
On 2023-03-01 14:48, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> wget -4 --timeout=15 -qO - checkip.dns24.ch 79.*.*.*cer@Telcontar:~>
No end line?
MYIP=`wget -4 --timeout=15 -qO - checkip.dns24.ch`;echo $MYIP
Good point. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
* Carlos E. R. <robin.listas@telefonica.net> [03-02-23 12:57]:
On 2023-03-02 01:17, Patrick Shanahan wrote:
* Carlos E. R. <robin.listas@telefonica.net> [03-01-23 16:48]:
On 2023-03-01 14:48, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> wget -4 --timeout=15 -qO - checkip.dns24.ch 79.*.*.*cer@Telcontar:~>
No end line?
MYIP=`wget -4 --timeout=15 -qO - checkip.dns24.ch`;echo $MYIP
Good point.
since one must be interested in the result and would use it somewhere else, having it stored in a variable is already necessary and that operation not required else where. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc
On 2023-03-02 19:01, Patrick Shanahan wrote:
* Carlos E. R. <robin.listas@telefonica.net> [03-02-23 12:57]:
On 2023-03-02 01:17, Patrick Shanahan wrote:
* Carlos E. R. <robin.listas@telefonica.net> [03-01-23 16:48]:
On 2023-03-01 14:48, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> wget -4 --timeout=15 -qO - checkip.dns24.ch 79.*.*.*cer@Telcontar:~>
No end line?
MYIP=`wget -4 --timeout=15 -qO - checkip.dns24.ch`;echo $MYIP
Good point.
since one must be interested in the result and would use it somewhere else, having it stored in a variable is already necessary and that operation not required else where.
Yes, my existing script uses a variable, I simply forgot about the new line. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
On 2023-03-02 18:57, Carlos E. R. wrote:
On 2023-03-02 01:17, Patrick Shanahan wrote:
* Carlos E. R. <robin.listas@telefonica.net> [03-01-23 16:48]:
On 2023-03-01 14:48, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> wget -4 --timeout=15 -qO - checkip.dns24.ch 79.*.*.*cer@Telcontar:~>
No end line?
MYIP=`wget -4 --timeout=15 -qO - checkip.dns24.ch`;echo $MYIP
Good point.
Use curl. Curl has been implementing the happy eyeballs algorithm for almost 10 years now. In short, happy eyeballs sends two connections, one with IPv6 and one with IPv4, and prioritize IPv6 when replying. -- /bengan
On 2023-03-02 19:59, Bengt Gördén wrote:
On 2023-03-02 18:57, Carlos E. R. wrote:
On 2023-03-02 01:17, Patrick Shanahan wrote:
* Carlos E. R. <> [03-01-23 16:48]:
On 2023-03-01 14:48, Per Jessen wrote:
Carlos E. R. wrote:
cer@Telcontar:~> wget -4 --timeout=15 -qO - checkip.dns24.ch 79.*.*.*cer@Telcontar:~>
No end line?
MYIP=`wget -4 --timeout=15 -qO - checkip.dns24.ch`;echo $MYIP
Good point.
Use curl. Curl has been implementing the happy eyeballs algorithm for almost 10 years now. In short, happy eyeballs sends two connections, one with IPv6 and one with IPv4, and prioritize IPv6 when replying.
Curious. But I really want only one line reply, or I would need parsing. The reply on IPv4 is trivial to parse and obtain the variable for the script. IPv6 I will see when I get it. Not yet. I can also obtain it from my own router via ssh; doable with an expect script, then parse the result. I did that with the previous incumbent and telnet. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
On 2023-03-02 20:12, Carlos E. R. wrote:
Curious. But I really want only one line reply, or I would need parsing. The
That's the thing. You only get one line in response. Happy Eyeballs takes care of that. If it's IPv6 you'll see IPv6, if it's IPv4 you'll see IPv4. If it is both, Happy Eyeballs will prioritize IPv6 and you will only see IPv6. Only one line in response. -- /bengan
On 2023-03-02 20:40, Bengt Gördén wrote:
On 2023-03-02 20:12, Carlos E. R. wrote:
Curious. But I really want only one line reply, or I would need parsing. The
That's the thing. You only get one line in response. Happy Eyeballs takes care of that. If it's IPv6 you'll see IPv6, if it's IPv4 you'll see IPv4. If it is both, Happy Eyeballs will prioritize IPv6 and you will only see IPv6. Only one line in response.
Can I control whether it is IPv4 or 6? Like a -4 or -6 parameter? Or maybe this goes against the Happy Eyeballs idea. I think it is better for me to launch the program twice, once for -6. another for -4, and obtain both variables separately. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
On 2023-03-02 20:57, Carlos E. R. wrote:
Can I control whether it is IPv4 or 6? Like a -4 or -6 parameter?
Yes, -4 and -6 gives you _only_ v4 or v6.
Or maybe this goes against the Happy Eyeballs idea.
Not really. It just disables the algorithm. The idea was to get people to use IPv6 without thinking.
I think it is better for me to launch the program twice, once for -6. another for -4, and obtain both variables separately.
Yes. You can do that. It's your choice. Happy Eyeball is implemented in most browsers today. Only wget chose not to implement it, for some reason. -- /bengan
On 2023-03-02 21:16, Bengt Gördén wrote:
On 2023-03-02 20:57, Carlos E. R. wrote:
Can I control whether it is IPv4 or 6? Like a -4 or -6 parameter?
Yes, -4 and -6 gives you _only_ v4 or v6.
Or maybe this goes against the Happy Eyeballs idea.
Not really. It just disables the algorithm. The idea was to get people to use IPv6 without thinking.
I think it is better for me to launch the program twice, once for -6. another for -4, and obtain both variables separately.
Yes. You can do that. It's your choice.
Well, the objective is to fill variables in a script with my current external IP, both IPv4 and IPv6 addresses. I can not yet test the later at home. I have "repaired" and older method I was using with my previous router: ask the router itself using the ssh interface. This is not documented, my ISP makes it harder each time. It is simply an expect script (generated with autoscript) that makes the router display the external interface information with command "wan show", then parse it.
Happy Eyeball is implemented in most browsers today. Only wget chose not to implement it, for some reason.
Ah, I see. <https://en.wikipedia.org/wiki/Happy_Eyeballs> Happy Eyeballs Happy Eyeballs (also called Fast Fallback) is an algorithm published by the IETF that makes dual-stack applications (those that understand both IPv4 and IPv6) more responsive to users by attempting to connect using both IPv4 and IPv6 at the same time (preferring IPv6), thus minimizing common problems experienced by users with imperfect IPv6 connections or setups. The name "happy eyeballs" derives from the term "eyeball" to describe endpoints which represent human Internet end-users, as opposed to servers.[1] Happy Eyeballs is designed to address the problem that many IPv6 networks are unreachable from parts of the Internet,[2] and applications trying to reach those networks will appear unresponsive, thus frustrating users. Happy Eyeballs solves this problem by determining which transport would be better used for a particular connection by trying them both in parallel.[3] An application that uses a Happy Eyeballs algorithm checks both IPv4 and IPv6 connectivity (with a preference for IPv6) and uses the first connection that is returned. The addresses are often chosen from the DNS with a round-robin algorithm.[4] Implementations of Happy Eyeballs stacks exist in Google's Chrome web browser, Opera 12.10, Firefox version 13, OS X,[5] cURL[6] and OpenBSD.[7] Happy Eyeball testing was part of World IPv6 Day in 2011.[8] The Happy Eyeballs algorithm may be extended for choosing between types of transport protocols as well, such as TCP and SCTP, but development is still in an experimental phase.[9] -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
Carlos E. R. wrote:
cer@Telcontar:~> wget -4 --timeout=15 -qO - checkip.dns24.ch 79.*.*.*cer@Telcontar:~>
No end line?
To save bandwidth :-) No, it is unnecessary and anyone processing the reply would likely only end up stripping it. -- Per Jessen, Zürich (2.9°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
participants (5)
-
Bengt Gördén
-
cagsm
-
Carlos E. R.
-
Patrick Shanahan
-
Per Jessen