How to get the ipv4 address from openwrt console?

Login my router which is running openwrt.

ssh  root@192.168.1.1
curl ip.sb
2408:8360:1e10:6b1:xx:xx:xx

How can get the ipv4 address with curl ?

RTFM :wink:

https://curl.se/docs/manpage.html

if you don't want to use the proper parameters (look for ipv4) in curl (might not be available, didn't try on openwrt) check your DNS settings.

Which setting file should i check?

I'd start by the DNS configuration, and your local DNS settings, if you've got one.

Do you just want to block this request, or all ipv6 traffic ?

curl ipv4.icanhazip.com ; curl ipv6.icanhazip.com
This would be the address internet sites see you. If you want to see the address the wan interface has, run ifstatus wan | grep address

Which configuration file decide the output action ?

Configuration file for what?

ipv4

like me and trendy said,

use a different IP lookup host, or make sure you tell curl to use ipv4 only.

1 Like