Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #266893 > unrolled thread

Network Problem: Redirection

Started byCharles Curley <charlescurley@charlescurley.com>
First post2024-02-02 22:10 +0100
Last post2024-02-04 15:30 +0100
Articles 14 — 5 participants

Back to article view | Back to linux.debian.user


Contents

  Network Problem: Redirection Charles Curley <charlescurley@charlescurley.com> - 2024-02-02 22:10 +0100
    Re: Network Problem: Redirection Marco Moock <mm@dorfdsl.de> - 2024-02-02 22:20 +0100
      Re: Network Problem: Redirection Charles Curley <charlescurley@charlescurley.com> - 2024-02-02 22:50 +0100
    Re: Network Problem: Redirection Greg Wooledge <greg@wooledge.org> - 2024-02-02 22:30 +0100
      Re: Network Problem: Redirection Charles Curley <charlescurley@charlescurley.com> - 2024-02-02 22:50 +0100
        Re: Network Problem: Redirection Greg Wooledge <greg@wooledge.org> - 2024-02-02 23:00 +0100
          Re: Network Problem: Redirection Charles Curley <charlescurley@charlescurley.com> - 2024-02-03 00:00 +0100
            Re: Network Problem: Redirection Charles Curley <charlescurley@charlescurley.com> - 2024-02-03 00:50 +0100
              Re: Network Problem: Redirection hw <hw@adminart.net> - 2024-02-04 12:50 +0100
      Re: Network Problem: Redirection Gremlin <scott-andrews@columbus.rr.com> - 2024-02-02 23:20 +0100
        Re: Network Problem: Redirection Marco Moock <mm@dorfdsl.de> - 2024-02-04 08:50 +0100
          Re: Network Problem: Redirection Gremlin <scott-andrews@columbus.rr.com> - 2024-02-04 13:20 +0100
            Re: Network Problem: Redirection Marco Moock <mm@dorfdsl.de> - 2024-02-04 15:10 +0100
              Re: Network Problem: Redirection Gremlin <scott-andrews@columbus.rr.com> - 2024-02-04 15:30 +0100

#266893 — Network Problem: Redirection

FromCharles Curley <charlescurley@charlescurley.com>
Date2024-02-02 22:10 +0100
SubjectNetwork Problem: Redirection
Message-ID<I38Xo-7rQ4-21@gated-at.bofh.it>
I have an interesting network problem. I have a samba service on hawk. I
have an alias for it in DNS:

root@hawk:~# host samba
samba.localdomain is an alias for hawk.localdomain.
hawk.localdomain has address 192.168.100.6
root@hawk:~# host hawk
hawk.localdomain has address 192.168.100.6
root@hawk:~# 

I can ping by IP address just fine:

root@hawk:~# ping 192.168.100.6
PING 192.168.100.6 (192.168.100.6) 56(84) bytes of data.
64 bytes from 192.168.100.6: icmp_seq=1 ttl=64 time=0.083 ms
64 bytes from 192.168.100.6: icmp_seq=2 ttl=64 time=0.034 ms
64 bytes from 192.168.100.6: icmp_seq=3 ttl=64 time=0.044 ms
64 bytes from 192.168.100.6: icmp_seq=4 ttl=64 time=0.052 ms
64 bytes from 192.168.100.6: icmp_seq=5 ttl=64 time=0.063 ms

--- 192.168.100.6 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4101ms
rtt min/avg/max/mdev = 0.034/0.055/0.083/0.016 ms
root@hawk:~# 

However, when I try to ping samba by host name:

root@hawk:~# ping samba
PING samba (192.168.122.1) 56(84) bytes of data.
From apt-proxy (192.168.100.12): icmp_seq=2 Redirect Host(New nexthop: hawk.localdomain (192.168.100.6))
From apt-proxy (192.168.100.12): icmp_seq=3 Redirect Host(New nexthop: hawk.localdomain (192.168.100.6))
From apt-proxy (192.168.100.12): icmp_seq=4 Redirect Host(New nexthop: hawk.localdomain (192.168.100.6))
From apt-proxy (192.168.100.12): icmp_seq=5 Redirect Host(New nexthop: hawk.localdomain (192.168.100.6))

--- samba ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4019ms

root@hawk:~# host apt-proxy
apt-proxy.localdomain is an alias for issola.localdomain.
issola.localdomain has address 192.168.100.12
root@hawk:~# 

192.168.100.12 is my router. apt-roxy is defined in /etc/hosts:

root@hawk:~# cat /etc/hosts
127.0.0.1	localhost
127.0.1.1	hawk.localdomain	hawk

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

# For the benefit of virtual machines.
192.168.100.12 apt-proxy
192.168.122.1 samba samba.localdomain
root@hawk:~# 

There is an apt-cacher-ng running on issola, 192.168.100.12. That
apt-proxy entry is for the benefit of virtual machines on hawk.

This mis-routing prevents the samba clients on hawk from mounting if I
use the host name. Other machines have no problems with the share.
However, as soon as I change hawk's fstab entry to the loopback
address, samba on hawk is fine.

Using the IP address works, but I'd rather use an alias in case some
time in the future I move the samba service to another machine; all I
need do is change the alias.

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

[toc] | [next] | [standalone]


#266894

FromMarco Moock <mm@dorfdsl.de>
Date2024-02-02 22:20 +0100
Message-ID<I3974-7rTb-1@gated-at.bofh.it>
In reply to#266893
Am 02.02.2024 um 14:03:46 Uhr schrieb Charles Curley:

> root@hawk:~# host samba
> samba.localdomain is an alias for hawk.localdomain.
> hawk.localdomain has address 192.168.100.6


> root@hawk:~# ping samba
> PING samba (192.168.122.1) 56(84) bytes of data.


Sorry for the first post.
Your problem is located in the name resolution.

Show /etc/nsswitch.conf


-- 
kind regards
Marco

Spam und Werbung bitte an ichschickereklame@cartoonies.org

[toc] | [prev] | [next] | [standalone]


#266896

FromCharles Curley <charlescurley@charlescurley.com>
Date2024-02-02 22:50 +0100
Message-ID<I39A5-7s2O-1@gated-at.bofh.it>
In reply to#266894
On Fri, 2 Feb 2024 22:10:19 +0100
Marco Moock <mm@dorfdsl.de> wrote:

> Sorry for the first post.
> Your problem is located in the name resolution.
> 
> Show /etc/nsswitch.conf

I have not touched this.

root@hawk:~# cat /etc/nsswitch.conf 
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         files systemd
group:          files systemd
shadow:         files
gshadow:        files

hosts:          files mdns4_minimal [NOTFOUND=return] dns mymachines
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
root@hawk:~# 


-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

[toc] | [prev] | [next] | [standalone]


#266895

FromGreg Wooledge <greg@wooledge.org>
Date2024-02-02 22:30 +0100
Message-ID<I39gJ-7rW1-3@gated-at.bofh.it>
In reply to#266893
On Fri, Feb 02, 2024 at 02:03:46PM -0700, Charles Curley wrote:
> root@hawk:~# host samba
> samba.localdomain is an alias for hawk.localdomain.
> hawk.localdomain has address 192.168.100.6

host(1) looks in DNS only.  It doesn't do the standard name resolution
that applications do.

> root@hawk:~# ping 192.168.100.6
> PING 192.168.100.6 (192.168.100.6) 56(84) bytes of data.
> 64 bytes from 192.168.100.6: icmp_seq=1 ttl=64 time=0.083 ms

> However, when I try to ping samba by host name:
> 
> root@hawk:~# ping samba
> PING samba (192.168.122.1) 56(84) bytes of data.

Note that this is a *different* IP address.

> # For the benefit of virtual machines.
> 192.168.100.12 apt-proxy
> 192.168.122.1 samba samba.localdomain

And that's where it came from (/etc/hosts).  If this IP address is
wrong, then it shouldn't be in here.

[toc] | [prev] | [next] | [standalone]


#266897

FromCharles Curley <charlescurley@charlescurley.com>
Date2024-02-02 22:50 +0100
Message-ID<I39A7-7s2O-13@gated-at.bofh.it>
In reply to#266895
On Fri, 2 Feb 2024 16:28:06 -0500
Greg Wooledge <greg@wooledge.org> wrote:

> > However, when I try to ping samba by host name:
> > 
> > root@hawk:~# ping samba
> > PING samba (192.168.122.1) 56(84) bytes of data.  
> 
> Note that this is a *different* IP address.

Good catch, thank you.

> 
> > # For the benefit of virtual machines.
> > 192.168.100.12 apt-proxy
> > 192.168.122.1 samba samba.localdomain  
> 
> And that's where it came from (/etc/hosts).  If this IP address is
> wrong, then it shouldn't be in here.

Gnrrr. It's right for the virtual network (192.168.122.0). But
shouldn't that work even if it isn't the "right" address?

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

[toc] | [prev] | [next] | [standalone]


#266898

FromGreg Wooledge <greg@wooledge.org>
Date2024-02-02 23:00 +0100
Message-ID<I39JL-7s62-5@gated-at.bofh.it>
In reply to#266897
> > > # For the benefit of virtual machines.
> > > 192.168.100.12 apt-proxy
> > > 192.168.122.1 samba samba.localdomain  
> > 
> > And that's where it came from (/etc/hosts).  If this IP address is
> > wrong, then it shouldn't be in here.
> 
> Gnrrr. It's right for the virtual network (192.168.122.0). But
> shouldn't that work even if it isn't the "right" address?

Well, we don't know what's "right" or "wrong" on your networks.  These
are private (non-routable) addresses with no meaning to anyone but you
and your fellow network denizens.

If you need different name resolution depending on whether you're
running on the host vs. running on the guest, then I would imagine there
is some well-known way to define that.  Perhaps a different hosts file
that's only used by guests?  I don't know virtualization stuff well.

[toc] | [prev] | [next] | [standalone]


#266901

FromCharles Curley <charlescurley@charlescurley.com>
Date2024-02-03 00:00 +0100
Message-ID<I3aFP-7sFF-11@gated-at.bofh.it>
In reply to#266898
On Fri, 2 Feb 2024 16:52:48 -0500
Greg Wooledge <greg@wooledge.org> wrote:

> Well, we don't know what's "right" or "wrong" on your networks.  These
> are private (non-routable) addresses with no meaning to anyone but you
> and your fellow network denizens.

Agree.

> 
> If you need different name resolution depending on whether you're
> running on the host vs. running on the guest, then I would imagine
> there is some well-known way to define that.  Perhaps a different
> hosts file that's only used by guests?  I don't know virtualization
> stuff well.

Yup. I took a quick and dirty route to solve a problem, and it leaked
over into another area. Sigh. The solution I took depends on the fact
that the libvirtual stuff uses dnsmasq for DNS and DHCP. And dnsmasq
reads the host machine's hosts file. Nice. But, as you pointed out, so
does the host machine's DNS lookup stuff. Sigh.

Possibly the solution to this problem is to see if I can take it out of
hosts, add it to dnsmasq directly, and finagle dnsmasq to only be
visible to the virtual machines.

But I don't think that will solve the routing problem.

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

[toc] | [prev] | [next] | [standalone]


#266902

FromCharles Curley <charlescurley@charlescurley.com>
Date2024-02-03 00:50 +0100
Message-ID<I3bsd-7tfv-3@gated-at.bofh.it>
In reply to#266901
On Fri, 2 Feb 2024 15:52:41 -0700
Charles Curley <charlescurley@charlescurley.com> wrote:

> But I don't think that will solve the routing problem.

Well, I was wrong. That did solve the routing problems.

I moved the apt-proxy line for the VMs' benefit into a VM's /etc/hosts
and took it out of hawk's /etc/hosts. samba is now an alias in the
virtual zone, so I don't need that line at all.

Thanks, Greg, for spotting that. Sometimes I'm dense. It took me a
while to realize what you were getting at.

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

[toc] | [prev] | [next] | [standalone]


#266942

Fromhw <hw@adminart.net>
Date2024-02-04 12:50 +0100
Message-ID<I3Jax-7OOd-5@gated-at.bofh.it>
In reply to#266902
On Fri, 2024-02-02 at 16:47 -0700, Charles Curley wrote:
> On Fri, 2 Feb 2024 15:52:41 -0700
> Charles Curley <charlescurley@charlescurley.com> wrote:
> 
> > But I don't think that will solve the routing problem.
> 
> Well, I was wrong. That did solve the routing problems.
> 
> I moved the apt-proxy line for the VMs' benefit into a VM's /etc/hosts
> and took it out of hawk's /etc/hosts. samba is now an alias in the
> virtual zone, so I don't need that line at all.
> 
> Thanks, Greg, for spotting that. Sometimes I'm dense. It took me a
> while to realize what you were getting at.
> 

This is not a routing problem in the first place.

If you have a DNS server configured that can resolve for you LAN(s)
(like you should), you don't need to (and should not) change anything
in /etc/hosts.  When you specify different addresses for the same host
at arbitrary places, you're likely to create confusion, especially
when you're using addresses that are supposed to have the same
meaning.  If you need to specify different names for the same host,
use CNAME records.  If you need to specify different addresses for the
same host, use different host names (at least I don't have a better
idea for that).

If you have vlans in use, make sure the addresses in the networks do
not overlap.  Otherwise your networks may not be as virtual as you
think, vlans or not, and you may create something that looks like a
routing problem.  If you're not using vlans and want virtual netwoks,
it's probably a very good idea to use vlans (and to use routing if
desirable and necessary).

[toc] | [prev] | [next] | [standalone]


#266900

FromGremlin <scott-andrews@columbus.rr.com>
Date2024-02-02 23:20 +0100
Message-ID<I3a37-7ssj-15@gated-at.bofh.it>
In reply to#266895
On 2/2/24 16:28, Greg Wooledge wrote:
> On Fri, Feb 02, 2024 at 02:03:46PM -0700, Charles Curley wrote:
>> root@hawk:~# host samba
>> samba.localdomain is an alias for hawk.localdomain.
>> hawk.localdomain has address 192.168.100.6
> 
> host(1) looks in DNS only.  It doesn't do the standard name resolution
> that applications do.
> 

host gremlin
gremlin.home.arpa has address 192.168.1.4
gremlin.home.arpa has IPv6 address fe80::a940:6c49:a620:4c09

[toc] | [prev] | [next] | [standalone]


#266936

FromMarco Moock <mm@dorfdsl.de>
Date2024-02-04 08:50 +0100
Message-ID<I3Fqi-7MkS-9@gated-at.bofh.it>
In reply to#266900
Am 02.02.2024 um 17:12:06 Uhr schrieb Gremlin:

> On 2/2/24 16:28, Greg Wooledge wrote:
> > On Fri, Feb 02, 2024 at 02:03:46PM -0700, Charles Curley wrote:  
> >> root@hawk:~# host samba
> >> samba.localdomain is an alias for hawk.localdomain.
> >> hawk.localdomain has address 192.168.100.6  
> > 
> > host(1) looks in DNS only.  It doesn't do the standard name
> > resolution that applications do.
> >   
> 
> host gremlin
> gremlin.home.arpa has address 192.168.1.4
> gremlin.home.arpa has IPv6 address fe80::a940:6c49:a620:4c09

You have to check from where the other IP address comes.

-- 
Gruß
Marco

Spam und Werbung bitte an ichschickereklame@cartoonies.org

[toc] | [prev] | [next] | [standalone]


#266943

FromGremlin <scott-andrews@columbus.rr.com>
Date2024-02-04 13:20 +0100
Message-ID<I3JDz-7PlL-1@gated-at.bofh.it>
In reply to#266936
On 2/4/24 02:39, Marco Moock wrote:
> Am 02.02.2024 um 17:12:06 Uhr schrieb Gremlin:
> 
>> On 2/2/24 16:28, Greg Wooledge wrote:
>>> On Fri, Feb 02, 2024 at 02:03:46PM -0700, Charles Curley wrote:
>>>> root@hawk:~# host samba
>>>> samba.localdomain is an alias for hawk.localdomain.
>>>> hawk.localdomain has address 192.168.100.6
>>>
>>> host(1) looks in DNS only.  It doesn't do the standard name
>>> resolution that applications do.
>>>    
>>
>> host gremlin
>> gremlin.home.arpa has address 192.168.1.4
>> gremlin.home.arpa has IPv6 address fe80::a940:6c49:a620:4c09
> 
> You have to check from where the other IP address comes.
> 

What other IP addresses.

His "problem" could have been resolved by properly setting up a DNS 
server. I also slay all the mDNS non sense.

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         files
group:          files
shadow:         files
gshadow:        files

hosts:          files  dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

[toc] | [prev] | [next] | [standalone]


#266949

FromMarco Moock <mm@dorfdsl.de>
Date2024-02-04 15:10 +0100
Message-ID<I3Lm1-7QpJ-5@gated-at.bofh.it>
In reply to#266943
Am 04.02.2024 um 07:12:50 Uhr schrieb Gremlin:

> I also slay all the mDNS non sense.

mDNS works fine if the host names are properly set and no other way of
setting the addresses (Unicast DNS, /etc/hosts) is being used.

-- 
kind regards
Marco

Spam und Werbung bitte an ichschickereklame@cartoonies.org

[toc] | [prev] | [next] | [standalone]


#266950

FromGremlin <scott-andrews@columbus.rr.com>
Date2024-02-04 15:30 +0100
Message-ID<I3LFo-7Qw8-17@gated-at.bofh.it>
In reply to#266949
On 2/4/24 09:03, Marco Moock wrote:
> Am 04.02.2024 um 07:12:50 Uhr schrieb Gremlin:
> 
>> I also slay all the mDNS non sense.
> 
> mDNS works fine if the host names are properly set and no other way of
> setting the addresses (Unicast DNS, /etc/hosts) is being used.
> 

It is not needed if the network is setup correctly with DNS.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web