Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

network problem

14 views
Skip to first unread message

Pierre Frenkiel

unread,
Oct 5, 2021, 4:10:03 PM10/5/21
to
hi,
I have the following problem on my laptop.
my /etc/network/interfaces file contains:
auto enp0s1
iface enp0s1 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1

but after boot, ifconfig gives

address 192.168.0.163
netmask 255.255.255.0
gateway 192.168.1.1

Then, networking works i.e. I can reach Internet, but of course
not my desktop and other devices 192.168.1.xx

I looked on the entire disk to find where this address 192.168.0.163
is hidden, but I was unable to find it !

rather strange, isn't it?

best regards,
--
Pierre Frenkiel

Dan Ritter

unread,
Oct 5, 2021, 4:40:03 PM10/5/21
to
First, let's see if you have the right interface.

ip link show |grep enp0s1

if that doesn't show you a line of config, you are specifying
the wrong interface.

ip link show

will show all of them to you.

Second, let's see if something else is doing the configuration:

grep -C1 ifupdown /etc/NetworkManager

(you want this to show managed=false)

ls /etc/systemd/network/

(you would like this to be empty)


Let us know what you find out.

-dsr-

Greg Wooledge

unread,
Oct 5, 2021, 4:40:04 PM10/5/21
to
On Tue, Oct 05, 2021 at 10:00:45PM +0200, Pierre Frenkiel wrote:
> hi,
> I have the following problem on my laptop.
> my /etc/network/interfaces file contains:
> auto enp0s1
> iface enp0s1 inet static
> address 192.168.1.10
> netmask 255.255.255.0
> gateway 192.168.1.1
>
> but after boot, ifconfig gives
>
> address 192.168.0.163
> netmask 255.255.255.0
> gateway 192.168.1.1

There is a *lot* to unpack here. I'm not sure where to start.

Let's start here: that is *not* the output of "ifconfig" on Debian.
The ifconfig command, which is not installed by default, but is available
in an optional package, does not produce output that looks anything
like that.

Most particularly, it does not show any information about routing. So
that "gateway" line that you claim it shows... that didn't come from
ifconfig, not even if you reformatted the hell out of it.

That leaves us to guess what you actually did, what the actual output
of ifconfig is, and why you're misleading us.

Now, let's assume for the sake of argument that you actually ran several
different commands, collated their output together in your head, and
rewrote it into this format. Let's even assume that you did not make
any typos during this entire procedure.

This still leaves us with some questions.

1) What is the actual name of your network interface?

The stanza in /etc/network/interface will only apply if the
interface's name is enp0s1. If it's not, then something else (perhaps
network-manager) will take over and configure the interface.

The 192.168.0.163 address might have come from DHCP. A fallback
configuration, like the one used by N-M, might be "run a DHCP client
and see if that works".

> Then, networking works i.e. I can reach Internet, but of course
> not my desktop and other devices 192.168.1.xx

2) What is your full routing table? "ip route" under modern era tools,
or "route -n" under the legacy tools.

It's not clear to me how you have working Internet access if your default
route is an address (192.168.1.1) that isn't on your subnet (192.168.0.0/24).

At the very least, you would need a route that leads you to the 192.168.0
network. Perhaps you have one. But you didn't show it.

Then, if for some reason you really *do* have a 192.168.0 address,
and a route to the 192.168.1 network, and a default gateway of 192.168.1.1,
and if all of this actually works, then... where did this routing table
get configured?

It's a mystery for sure.

You might want to look for log files that indicate what's happening. They
could be in /var/log/ or you might need to use journalctl.

Meanwhile, use "ip addr" and "ip route" to see what your actual network
configuration is. Don't reformat it. Don't omit pieces of it. Don't
mash the two together.

ghe2001

unread,
Oct 5, 2021, 5:10:04 PM10/5/21
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Most peculiar indeed.

Does the interface always get the same address?

Have you tried setting the IP with ifconfig -- after the box is up with the bad IP address?

Is there anything in /etc/init.d that might be doing it?

Have you looked at dmesg? (That 163's gotta be somewhere.)

Have you looked at what's in /etc/network/interfaces.d? (There's nothing in mine, but ifup works as expected here.)

Have you tried Webmin? (I know, I know, but it works.)

Have you tried pinging the two addresses? (Not likely, but something's bent somewhere.)

A workaround: change the netmask everywhere on your LAN to 255.255.0.0 and let the address be whatever systemd wants to assign to it :-)

--
Glenn English
-----BEGIN PGP SIGNATURE-----
Version: ProtonMail

wsBzBAEBCAAGBQJhXL2SACEJEJ/XhjGCrIwyFiEELKJzD0JScCVjQA2Xn9eG
MYKsjDLdhwgAwp4apR3uGebYU5bOx+qQbh8iGDFa+sPxMzqdzYa0bVBcoaUE
hzxPw1+pAe3vEfD/VYYrm5GGC4aUHILqH7SffpMMbWEZtSaL5ghKC8EGZhlk
wcP0d7p3paPNvKpCHMOUkxDQOd04Cqu+gudkeiQasqAPBqnTzLpk0sEBIsj9
EMeA/RCivsIGt+VvNQPaR2+surTnubOx95pwT/SmFT1at6awcbiYYNjUU08T
rnOdSAA1A7/X5UED1Mo5R+6k/DT3DqKzkK1jmwY1IKt24iBLH4wn/2md6j8w
WpbLDjn/U9Gb+rpNqdEhLkVwMgLrxFRkyKkH+gJangN7JyExoT6RbQ==
=Ze8U
-----END PGP SIGNATURE-----

Reco

unread,
Oct 6, 2021, 1:40:03 AM10/6/21
to
Hi.

On Tue, Oct 05, 2021 at 10:00:45PM +0200, Pierre Frenkiel wrote:
> hi,
> I have the following problem on my laptop.
> my /etc/network/interfaces file contains:
> auto enp0s1
> iface enp0s1 inet static
> address 192.168.1.10
> netmask 255.255.255.0
> gateway 192.168.1.1

That's probably Ok.


> but after boot, ifconfig gives
>
> address 192.168.0.163
> netmask 255.255.255.0
> gateway 192.168.1.1

And that is not.

First, ifconfig is not able to show you IP routing, so please be more
specific at how exactly you've got this result.
Second, it's impossible to have a working default gateway that's outside
the subnet you're having, and it's exactly what you have here.

> Then, networking works i.e. I can reach Internet, but of course
> not my desktop and other devices 192.168.1.xx

Third, the whole purpose of default gateway is to let you communicate
with host that are outside your subnet.


> rather strange, isn't it?

dpkg -l 'ifupdown*'
dpkg -l 'network*'

Reco

Pierre Frenkiel

unread,
Oct 6, 2021, 8:10:04 AM10/6/21
to
please note that the main problem is
"why the /etc/network/interfaces" is not used?"

Greg Wooledge

unread,
Oct 6, 2021, 8:20:03 AM10/6/21
to
On Wed, Oct 06, 2021 at 02:09:23PM +0200, Pierre Frenkiel wrote:
> please note that the main problem is
> "why the /etc/network/interfaces" is not used?"

Please show us the information you've been asked to show, by multiple
people:

ip addr
ip route

Brian

unread,
Oct 6, 2021, 11:20:03 AM10/6/21
to
On Wed 06 Oct 2021 at 14:09:23 +0200, Pierre Frenkiel wrote:

[...]

> I have the following problem on my laptop.
> my /etc/network/interfaces file contains:
> auto enp0s1
> iface enp0s1 inet static
> address 192.168.1.10
> netmask 255.255.255.0
> gateway 192.168.1.1

Just in passing: The line with netmask 255.255.255.0 can be deleted.
It is a deprecated option, as is broadcast. See #912220.

--
Brian.

Thomas Pircher

unread,
Oct 6, 2021, 12:00:04 PM10/6/21
to
Brian wrote:
>Just in passing: The line with netmask 255.255.255.0 can be deleted.
>It is a deprecated option, as is broadcast. See #912220.

Crikey, it is indeed deprecated. Just removing the line will probably
not be a good idea. I guess it can be deleted only when the address line
contains the netmask in CIDR notation:
>> address 192.168.1.10/24

Thomas

Brian

unread,
Oct 6, 2021, 12:30:04 PM10/6/21
to
That looks to be the situation, according to examples in interfaces(5).
Mind you

address 192.168.7.40

works for me. Don't ask me why. It is easy enough to rectify.

--
Brian.

David

unread,
Oct 6, 2021, 7:40:04 PM10/6/21
to
On Wed, 6 Oct 2021 at 23:09, Pierre Frenkiel <pierre....@gmail.com> wrote:
>
> please note that the main problem is
> "why the /etc/network/interfaces" is not used?"

Ok. Noted.

Several knowledgeable and helpful people have already
made an effort trying to help you answer exactly this.
You can find those efforts in the 4 links labelled "Follow-Ups"
at the bottom of this web page:
https://lists.debian.org/debian-user/2021/10/msg00244.html

If you do not engage with those efforts then it really is a
puzzle to understand what kind of help you expect when
you write to this list.

Should we conclude that you prefer to solve this without
our assistance?

If that is the case, you could do the following:

First, learn what DHCP is.

Second, learn what all the commands (that others
have suggested in the links above) do, and how to
understand their outputs.

Third, use those commands to answer the question yourself.

If that is not the case, then perhaps you could explain
what kind of help you do expect when you ask a question
here.

rhkr...@gmail.com

unread,
Oct 6, 2021, 8:00:04 PM10/6/21
to
Does that mean 255.255.255.0 is the default netmask?

David

unread,
Oct 6, 2021, 8:10:02 PM10/6/21
to
The netmask has to be specified *somewhere*. My understanding
is that either CIDR or 'netmask' is required to do that. Read
about CIDR here:
https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation

But others here are vastly more knowledgeable than I am about
networks, so additions or corrections are welcome, as always :)

David Wright

unread,
Oct 6, 2021, 9:40:03 PM10/6/21
to
On Wed 06 Oct 2021 at 14:09:23 (+0200), Pierre Frenkiel wrote:
> please note that the main problem is
> "why the /etc/network/interfaces" is not used?"

> I have the following problem on my laptop.
> my /etc/network/interfaces file contains:
> auto enp0s1
> iface enp0s1 inet static
> address 192.168.1.10
> netmask 255.255.255.0
> gateway 192.168.1.1
>
> but after boot, ifconfig gives
>
> address 192.168.0.163
> netmask 255.255.255.0
> gateway 192.168.1.1
>
> Then, networking works i.e. I can reach Internet, but of course
> not my desktop and other devices 192.168.1.xx
>
> I looked on the entire disk to find where this address 192.168.0.163
> is hidden, but I was unable to find it !
>
> rather strange, isn't it?

One possibility might be that you've somehow got yourself connected to
the WAN side of your router, rather that the LAN side.
I think you should login to your router and see what the address of
the Internet Port is.
I seem to remember that happening to someone here with one of those
"captive" or ISP-managed modem/routers.
It's one reason why we run three routers at home: one that Cox rent,
the real one (mine), and one with a broken WAN port that we use as
a switch and wireless repeater.

Cheers,
David.

Lee

unread,
Oct 6, 2021, 10:00:03 PM10/6/21
to
On 10/6/21, David wrote:
It's Classless Inter-domain Routing (CIDR) now and network masks are
no longer supported [1]. If you take a look at RFC-950 [2], there is
no requirement that the network and sub-network bits of an address be
contiguous. 252.252.252.252 was a perfectly valid mask and yields the
same number of host bits (8) as a 255.255.255.0 mask does.

Then along came CIDR and dis-contiguous network/subnet bits were prohibited.

Lee


[1] Specifically, _bitmasks_ are no longer supported. "network masks"
are now just another way of specifying the first however many bits of
an address that make up the network portion of an address - eg. /24
and 255.255.255.0 both specify the first 24 bits of an address

[2] https://datatracker.ietf.org/doc/html/rfc950#page-15

3. A Class C Network Case (illustrating non-contiguous subnet bits)

For this case, assume that the requesting host is on class C
network 192.1.127.0, has address 192.1.127.19, that there is a
gateway at 192.1.127.50, and that on network an 3-bit subnet field
is in use (01011000), that is, the address mask is 255.255.255.88.

David

unread,
Oct 6, 2021, 10:10:03 PM10/6/21
to
On Thu, 7 Oct 2021 at 12:53, Lee <ler...@gmail.com> wrote:
> On 10/6/21, David wrote:

> > But others here are vastly more knowledgeable than I am about
> > networks, so additions or corrections are welcome, as always :)

> It's Classless Inter-domain Routing (CIDR) now and network masks are
> no longer supported [1]. If you take a look at RFC-950 [2], there is
> no requirement that the network and sub-network bits of an address be
> contiguous. 252.252.252.252 was a perfectly valid mask and yields the
> same number of host bits (8) as a 255.255.255.0 mask does.
>
> Then along came CIDR and dis-contiguous network/subnet bits were prohibited.

Ahhh, that's interesting, I didn't know about that aspect.

Thank you for taking the time to explain clearly, with links.
I really appreciate it!
0 new messages