LWN.net Logo

Udev and systemd to merge

Udev and systemd to merge

Posted Apr 6, 2012 12:20 UTC (Fri) by cortana (subscriber, #24596)
In reply to: Udev and systemd to merge by scientes
Parent article: Udev and systemd to merge

I don't think NM cares about the kinds of each connection involved in sharing. One quirk that I never bothered to raise upstream was that you're not supposed to set the mode of the *upstream* connection to 'shared to other computers'; you're supposed to set the mode of the *local* connection. Perhaps NM sets up some iptables rules so that only packets from local interface marked as 'shared to other computers' will be routed out of the upstream interface... I didn't bother to look into it once I made it work. :)


(Log in to post comments)

Udev and systemd to merge

Posted Apr 6, 2012 14:39 UTC (Fri) by Eckhart (guest, #74500) [Link]

The way NetworkManager works is actually pretty simple. Unless a connection is marked "Shared", it is considered a potential upstream connection. Of all the upstream connections, the best one is marked the default gateway, with simple ordering (i.e. vpn wins over cable, cable wins over wireless…).
A connection marked as shared will get a DHCP server and uses NAT to route traffic over the default gateway. Therefore it is perfectly possible to share your 3g connection via ethernet to a bunch of computers.

Udev and systemd to merge

Posted Apr 6, 2012 19:44 UTC (Fri) by scientes (guest, #83068) [Link]

> One quirk that I never bothered to raise upstream was that you're not supposed to set the mode of the *upstream* connection to 'shared to other computers'; you're supposed to set the mode of the *local* connection.

as someone that has basic understanding of the networking, and has done this manually, this makes perfect sense, the other way you talk of is confusing, and would be way less capable.

If it wasn't for ipv4 exhaustion, sharing your internet connection could as simple as turning on ipv4 packet forwarding. (now there is also address allocation issues, so DHCP) the complexity, and ever difference between upstream, and downstream, somes from Network Address Translation.

Udev and systemd to merge

Posted Apr 6, 2012 20:02 UTC (Fri) by cortana (subscriber, #24596) [Link]

I find it confusing to have to set the mode of the downstream interface to 'share with other computers'. It's my internet connection I want to share, so I naturally expect to set its interface, the upstream one, to 'share with other computers'; the upstream connection is what I'm sharing, and is therefore be the object in the sentence "Share my internet connection with other computers".

Udev and systemd to merge

Posted Apr 6, 2012 20:23 UTC (Fri) by scientes (guest, #83068) [Link]

thats only because you are considering yourself a slave to your Internet connection, and a slave to the Internet. The way it works, it will share any connections you have, even if you dual-banding with the neighbor that has a differn't ISP so that you don't have to worry about censorship, are to evade network neutrality violations.

sure maybe the language needs to be made clearer, "share Internet to this interface?"

Udev and systemd to merge

Posted Apr 6, 2012 20:37 UTC (Fri) by cortana (subscriber, #24596) [Link]

That language change would definitely be a lot better.

Udev and systemd to merge

Posted Apr 6, 2012 20:39 UTC (Fri) by khim (subscriber, #9252) [Link]

It's my internet connection I want to share, so I naturally expect to set its interface, the upstream one, to 'share with other computers'; the upstream connection is what I'm sharing, and is therefore be the object in the sentence "Share my internet connection with other computers".

Well, it'll be nice psychology study which will show just why Joe Average gets the facts backward, but this logic is obviously quite strange.

Let's forget about network, routing, packets, etc. Suppose my neighbour lost electrical power and I, ever the helpful guy, want to share my grid power connection with him (electrical grid, not Internet).

Now, I have two choice:
1. I can go find out where and how my own house itself is connected to grid and try to change that global connection. I can even succeed and survive (if I'm lucky).
  or
2. I can change my local connection configuration: just plug extension cord to my wall socket and attach appliances of my neighbour to it.

Somehow when electrical grid is concerned everyone automatically assumes solution #2 is right, but for Internet they want go and try to change WAN#1 (their WAN connection)? WHY? What's so special about Internet?

P.S. This phenomenon is quite obviously present because Microsoft tries to “help” here. It ALSO makes no sense to change WAN configuration when you share it even in Windows, but hey, if people en masse want to do this strange thing then this is how it should be done. As a result when you share network connection you must “alter” WAN connection, but this is illusion. When you try to “share” WAN connection in Windows WAN connection is not changed at all. Instead Windows goes and silently changes LAN connection behind your back.

The end result is essentially the same as with Linux, but with a twist: in simple cases everything “just works”, but in complex cases you must imagine these behind the scenes changes and do complex dance (Ok, I need to change this network in this and that way, but this is impossible to do so I need to create fictive temporary network and change THIS, then I can delete it because it's unneeded and I can fix THAT and but this well mean that networks will be disconnected but this can be fixed later…) I hate that.

Udev and systemd to merge

Posted Apr 6, 2012 20:54 UTC (Fri) by scientes (guest, #83068) [Link]

#1. the entire concept of LAN vs. WAN only propagates this confusion

#2. The Linux way of electricity networking does exist in your 2nd electrical example, its called a Widow-maker or other similarly ominous names. (for good reason)

Udev and systemd to merge

Posted Apr 6, 2012 21:25 UTC (Fri) by khim (subscriber, #9252) [Link]

The Linux way of electricity networking does exist in your 2nd electrical example, its called a Widow-maker or other similarly ominous names. (for good reason)

s/Linux/Windows/

Widow-maker is used to attach to the upstream, to “WAN” power grid (this is what you “naturally expect” for some reason). This is Windows way.

In Linux you share your wall outlets (you local in-house “LAN” electric network) instead.

the entire concept of LAN vs. WAN only propagates this confusion

Why? WAN == WIDE area network (think city-level or even wider electrical network), LAN == LOCAL area network (think you own tiny in-house network with dozen or two plugs and few appliances). If you want to share electricity with someone you most definitely will do it using your local network (unless you have some serious reasons to use thing which is called Widow-maker or other similarly ominous names).

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds