Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how do I make avahi preferably use ipv4?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
piotr5
Tux's lil' helper
Tux's lil' helper


Joined: 14 Dec 2012
Posts: 117

PostPosted: Sat Jan 06, 2024 1:23 pm    Post subject: how do I make avahi preferably use ipv4? Reply with quote

I#m using KDE with systemd and avahi starts without problems. however

Code:
systemctl status avahi-daemon
...
avahi-daemon[4340]: Joining mDNS multicast group on interface enp1s0.IPv6 with address fe80::534f:cd02:ca2a:6eee.
avahi-daemon[4340]: New relevant interface enp1s0.IPv6 for mDNS.
avahi-daemon[4340]: Registering new address record for fe80::534f:cd02:ca2a:6eee on enp1s0.*.
avahi-daemon[4340]: Joining mDNS multicast group on interface enp1s0.IPv4 with address 192.168.0.52.

so it seems to be using both, my ipv4 address as registered on the hub, and a new ipv6 address. it might be my firewall's fault, but ping on my avahi domain name says I'm at addreess 0.0.0.17 although all packets there are lost and not even noticed by firewall. however, when I connect another linux (without systemd) to the network and ping it, I get again all packets lost to the address fe80::2b22:1e46:274:1685 which sounds like ipv6. (on the other computer ping actually sends data to the correct ipv4 address successfully.) I tried to use the piv6 address "sftp://p@fe80::2b22:1e46:274:1685:22/home/p" in dolphin and get the error that webpages are not supported and browser is being started with "http://sftp/p@fe80::2b22:1e46:274:1685:22/home/p/" revealing that dolphin does not support ipv6.

needless to say, at my current configuration everything worked in past, an update on this computer without updating the other is what lead to the current problem. a temporaty fix was to go to the other computer, write down its ipv4 address and use that in dolphin. but isn't avahi supposed to do that automatically? instead dolphin gives me an error about an invalid argument when using the other computer's domain-name...
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3150

PostPosted: Sat Jan 06, 2024 2:27 pm    Post subject: Reply with quote

Why do you put ipv6 address in the browser in the first place?
You have avahi, just use machine's name and let it be resolved automagically for you. Do you have nss-mdns installed and enabled in /etc/nsswitch.conf ?
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 325
Location: Naarm/Melbourne, Australia

PostPosted: Sun Jan 07, 2024 12:51 am    Post subject: Reply with quote

Addressing the specific question in the subject line of your post, i don't know how to specify "try ipv4, and only use ipv6 if ipv4 isn't available", but one can disable either protocol in /etc/avahi/avahi-daemon.conf:

Code:
use-ipv4=yes
use-ipv6=no
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum