Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've been using Lx for years including Gentoo in the past, so I know the rudiments of networking. I'm now using Debian, getting into the nitty-gritty, and decided to start with a puzzle about my 3G modem. The box has a single ethernet socket for eth0 to which I assign 192.168.1.111. /etc/network/interfaces:
The modem configures itself as eth1 with 192.168.1.1 which I can ping. It's a Huawei with inbuilt web interface that presents a control screen at http://192.168.1.1/html/home.html Following boot, when I first try to access this it hangs. If I use ># ifdown eth0 I can access it, even if I then bring eth0 up again: ># ifup eth0. This is the first anomaly I don't understand.
The second is more fundamental. The kernel assigns 192...0 to both ports (which may be special-purpose?):
Code:
># route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default m.home 0.0.0.0 UG 1024 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
... yet this 192...0 address doesn't appear anywhere else. Also, it seems that the modem has also grabbed 192...100 which I can also ping:
Your 3G modem is configured to use 192.168.1.0/24 as the "internal" networking, so when you plug it in, it's creating a (usb?) ethernet device (eth1) and assigning this the address of 192.168.1.100 and telling the kernal to use this interface (and IP address, etc.) to route traffic.
This conflicts with what you're configuring your onboard eth0 with manually, which is why it's showing up on your routing table as eth0.
You are trying to configure two NICs with the same network. This is generally considered a bad thing!.
Check your 3G device, you should be able to configure the "internal" networking to use a different network (192.168.2.0/24 for example) or configure your onboard with a non-conflicting network.
> Is this some laptop with a built in 3g modem?
> I can't figure out how you can have a eth0 and eth1 normally otherwise.
No, standard desktop. eth0 is the internal NIC, the eth1 stuff is all done by Modem Magic.
> Your 3G modem is configured to use 192.168.1.0/24 as the "internal" networking
i.e. the LAN, I take it. BTW, is 192...0 a "special address" in the way thet 192...255 is BROADCAST?
> when you plug it in, it's creating a (usb?) ethernet device (eth1)
Yep, can see that.
> and assigning this the address of 192.168.1.100
... some sort of default, I assume.
> and telling the kernal to use this interface (and IP address, etc.) to route traffic.
All clear so far.
> This conflicts with what you're configuring your onboard eth0 with manually, which is why it's showing up on your routing table as eth0.
I don't follow this. Where is the conflict, esp as eth0 isn't connected to anything? eth0 is in /etc/network/interfaces so I suppose it grabs the label (eth0) first, and the modem moves up to eth1? See next post.
> You are trying to configure two NICs with the same network.
But doesn't every device on a network have a Network Interface Chip with a different MAC and different IP address? Yes, but each device is assumed to have only ONE connection to each subnet, not two as I'd inadverdently set up.
> Check your 3G device, you should be able to configure the "internal" networking to use a different network (192.168.2.0/24 for example)
The best I can make of this is that the modem wants to act as a bridge between two subnets ( ..1.0 and ..2.0 ) and I'm trying to point it back to just one. I think this is about right.
My own ignorance of basic network theory is to blame here, but I've not been able to find anything in the literature I've got that explains this. If you'd be kind enough to clarify or point me to suitable lit I'd be most grateful, and many thanks for this reply.
I've pasted in the routing info after >#ifdown eth0. Still can't see where 192.168.1.1 comes into the story, other than that it seems to be a default address for most modem/routers:
> I'd say yes if you can tell us how this modem is attached to your desktop.
Standard USB 3G modem - by a USB port. But it "fakes" a network connection - i.e. NIC. This "masquerading" that USB devices do is one of the trickiest things to document unless you're perfectly clear about what's going on, in my experience.
I've now got a different "mental schematic" of the setup thanks to TenTenths. Am using Dia to get it down on paper.
Just had a flash of ?insight? I'd been thinking of the modem as something "external" when in fact it's "internal" - i.e. a part of the box.
So the entire BOX becomes a router, and its two eth ports must therefore point to different subnets. Correct?
Yup, you're getting there.
So, you now have a laptop that has two ethernet connections. One it the classic "hole in the laptop" that a cable goes in to. The other is created when you plug in your 3G modem. This acts like an ethernet network with two devices on it. Your laptop and the 3G modem. The "lan" side of this device is using then network 192.168.1.0 which is really a shorthand for the subnet 192.168.1.1 to 192.168.1.255
Your 3G modem is assigning itself the network address of 192.168.1.1 and is then giving your laptop a DHCP address of 192.168.1.100 (as it likely has this as the start of its DHCP "pool" and giving it the default gateway of 192.168.1.1
If you're using the route command then use route -n which will display the IP addresses of things rather than changing some of them to names.
192.168.1.0 is indeed a "special" subnet. It's part of the reserved private address space and is the most common one used for off-the-shelf devices such as routers/modems/etc. https://en.wikipedia.org/wiki/Privat...address_spaces
> So, you now have a laptop that has two ethernet connections ... 192.168.1.1 to 192.168.1.255
Yes, all clear now.
> use route -n
THAT's what I was looking for. Just 'route' shows it calling itself 'm.home' whereas'route -n' shows the 'missing IP' 192.168.1.1.
> 192.168.1.0 is indeed a "special" subnet. It's part of the reserved private address space ...
Thought I remembered this from somewhere.
BTW for others watching this and my own clarification:
I remember way back when I had one of the early Inet wireless modems, I think it connected via Cat5 but using PPPOE - PPP protocol over Ethernet - and so 'looked like' a serial port, not a network connection. My other USB 3G modem is a Huawei E169 which 'looks like' a serial port and can be set up using PPP according to OpenWrt docn, in which case it would not be a network connection as far as the box is concerned. This new modem is a Huawei E8372 which 'looks like' a NIC and so IS a network conx to the box. Yes?
Many thanks for your clues and explanations; I'll put away the ouija board and the voodoo mask.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.