News for hackers. Stuff that matters.
Re:Container networking is simple (2020) by caymanjim on Tuesday January 19, 2021 @01:50PM (#25837068)
This is...not simple. I agree that container networking is not all that much different from other Linux networking, but that doesn't make it simple. A lot of application developers are switching to working with containers and haven't historically had to do any manual network configuration. It's all new to them. Linux networking conventions change every few years and simplying keeping up with the basics is a chore. netplan is the current flavor of the week but it's still new to plenty of people who've never had to worry about anything more than auto-configured DHCP or cloud-provider-default VPS networking.

There are also important security considerations with container networking. Docker, by default, punches massive holes through your firewall in non-obvious ways. People don't realize that with a default Docker configuration, containers are ignoring any normal firewall rules you may have setup with iptables or ufw. Locking that down is only easy if you already know iptables well, and even if you do, managing it is a pain.

The article doesn't touch on Kubernetes, but that's a whole other can of worms. You have to pick a CNI and manually configure it; DNS doesn't just magically work; default CIDR allocations often conflict with existing networks; load balancer ingress for a development/single-host/non-cloud environment is a horror show.

This is a good and helpful article, but container networking is not simple by any stretch.

Re:Container networking is simple (2020) by stonesweep on Tuesday January 19, 2021 @02:17PM (#25837514)
> netplan is the current flavor of the week

... for Ubuntu, and Ubuntu only. It is an invention of Canonical not adopted by the rest of Linux distros (except Ubuntu derivatives), generally speaking.

Re:Container networking is simple (2020) by pnutjam on Tuesday January 19, 2021 @03:19PM (#25838332)
Long live wicked, easily managed with Yast on OpenSuse.
Re:Container networking is simple (2020) by mongol on Wednesday January 20, 2021 @02:00AM (#25843330)
Yes, but how do you manage it without yast?
Re:Container networking is simple (2020) by pnutjam on Thursday January 21, 2021 @10:30AM (#25859864)
try: wicked --help

... but the beautiful thing about yast, is you get the interface via gui or console and it's largely identical.

Re:Container networking is simple (2020) by skrtskrt on Tuesday January 19, 2021 @03:13PM (#25838258)
Any good books on Linux networking?

I have started spinning up “bare metal” k8s on a cloud VM and it’s not that hard to get going until you get to anything networking related then I feel like I’ve just jumped off a cliff. I have no knowledge there and the online resources seem to be nonexistent because you’re expected to just use a prebaked solution from cloud providers.

I ended up just installing k3s but I have yet to figure out where the Traefik packaged in k3s can listen directly on port 80 and 443, but the basic Traefik installed via Helm cannot

Re:Container networking is simple (2020) by kazen44 on Tuesday January 19, 2021 @04:08PM (#25838910)
To be fair, starting with something like a BSD might be easier in terms of networking. Mainly because the tooling hasn't been all over the place in the last 2 decades.

Also, a lot of network knowledge is not OS specific. Learning about IP, ethernet, routing protocols etc is valuable no matter which OS you use.

Re:Container networking is simple (2020) by tiew9Vii on Tuesday January 19, 2021 @07:19PM (#25840919)
I agree.

I've had years of Linux experience and decided my home network + router was quite poor and I'd set up my own home network router and use OpenBSD to do it as an excuse to look at a BSD and fix my network issues.

OpenBSD has been an absolute pleasure to work with. The man pages are well written and complete, the filesystem is well organized, having no issues that people have with Systemd the simplicity of OpenBSD's init system showed you don't need complex init systems. Then you have PF which is far easier to deal with than IP tables.

It took me a few hours of playing to set OpenBSD up with multiple vlan's, dhcp server, firewall, cross vlan routing, mdns etc. The hardest part was figuring out the correct parameters for my ISP broadband connection as the ISP didn't publish some of the information so needed to sniff the network traffic to find that i needed to set a vlan for my isp.

The simplicity of OpenBSD makes it very easy to learn networking and if you are familiar with Linux you will become familiar with BSD very quickly as BSD's are less fragmented than Linux by their nature.

Re:Container networking is simple (2020) by __turbobrew__ on Tuesday January 19, 2021 @09:30PM (#25841893)
I was amazed when my OpenBSD network config worked on the first try using only the man pages as reference.

On the other hand it took me the better part of an hour to figure out how to change the DNS server used by an Ubuntu install.

Re:Container networking is simple (2020) by ohnemint on Wednesday January 20, 2021 @07:09AM (#25845457)
> On the other hand it took me the better part of an hour to figure out how to change the DNS server used by an Ubuntu install.

Might I ask why/how exactly?

Re:Container networking is simple (2020) by __turbobrew__ on Thursday January 21, 2021 @08:15PM (#25867005)
Well, I first checked /etc/resolv.conf which told me to change the dns settings in systemd. So I read up on the systemd documentation and tried to change the dns setting using systemd-resolved but got a permissions error. So I did a bunch of reading online and found out that netplan is actually used to configure the dns so I spent some time reading the netplan documentation on how to change the dns server. This process took me about an hour.
Re:Container networking is simple (2020) by skrtskrt on Tuesday January 19, 2021 @04:42PM (#25839287)
I have done some learning about more generalized network concepts (ip addresses, protocols, routing) but I want to make the jump to actually apply it in some VMs now

I think my next stop is the network section of Unix and Linux System Administration Handbook

Re:Container networking is simple (2020) by psibi on Wednesday January 20, 2021 @02:25AM (#25843520)
I was in the same boat and I found Michael Lucas book quite good for getting the practical working knowledge: https://books.google.co.in/books/about/Networking_for_System...

It tries to address the concepts and the book covers for multiple operating system like Windows, Linux, BSD and even has Some Solaris tidbits. :-)

Re:Container networking is simple (2020) by teleforce on Wednesday January 20, 2021 @01:18PM (#25849870)
Strangely there is no current books for the state of the art Linux networking.

Here are a few and far between books on Linux networking but they are seriously outdated [1][2]. I think it's about time someone write an authoritative book on Linux networking in the light of the recent changes on Netfilter, bpfilter, eBPF and LXC container.

[1] Linux Kernel Networking: Implementation and Theory, 2013

[2] Linux Routers: A Primer for Network Administrators, 2nd Edition, 2002

Re:Container networking is simple (2020) by yrro on Tuesday January 19, 2021 @05:57PM (#25840087)
https://access.redhat.com/documentation/en-us/red_hat_enterp... though it's a bit task based

http://policyrouting.org/PolicyRoutingBook/ONLINE/TOC.html but chapter 4 which introduces/explains how to use the ip command never got written!

Re:Container networking is simple (2020) by yrro on Thursday January 21, 2021 @05:36AM (#25857498)
Correction: chapter 4 is in the printed book. On the web site, it's found at http://policyrouting.org/iproute2-toc.html. The links from the other chapters of the web site don't work but browsing the ToC of the book, it looks like this link on the web site has all the info from the book plus a bit more...
Re:Container networking is simple (2020) by speakspokespok on Tuesday January 19, 2021 @06:04PM (#25840163)
A -- "A lot of application developers are switching to working with containers and haven't historically had to do any manual network configuration. It's all new to them."

B -- "Linux networking conventions change every few years and simplying keeping up with the basics is a chore. netplan is the current flavor of the week but it's still new to plenty of people who've never had to worry about anything more than auto-configured DHCP or cloud-provider-default VPS networking."

My perspective has been that "A" is directly leading to "B" for similar reasons new javascript frameworks keep being released. Linux networking conventions don't change rapidly (5 - 10 years) but new management tooling does get created alongside to sit next to existing tooling, already abstracted out OS tools have new tooling to further abstract out system management which just creates further unnecessary complexity.

Re:Container networking is simple (2020) by jasonjayr on Tuesday January 19, 2021 @10:58PM (#25842435)
> Linux networking conventions change every few years and simplying keeping up with the basics is a chore.

Debian has used /etc/network/interfaces for as long as I know. (at least 15+ years) It's sane, short and straightforward. For servers, this has been more than ideal for every setup I could conceive.

Re:Container networking is simple (2020) by kenniskrag on Tuesday January 19, 2021 @05:20PM (#25839695)
> through your firewall in non-obvious ways. People don't realize that with a default Docker configuration, containers are ignoring any normal firewall rules you may have setup with iptables or ufw.

What do you mean by non-obvious? If I bind a port of the container to the host eg. -p 8080:80 only this port is a hole. Do you have something different in mind? (I'm a docker beginner)

Re:Container networking is simple (2020) by caymanjim on Tuesday January 19, 2021 @06:53PM (#25840651)
That alone is non-obvious. Docker adds prerouting and masquerade changes. They don't show up in the default iptables rule list (iptables -L). If you don't know about it creating the other tables it adds, and how to list them explicitly, you won't see these rules added. Docker binds to the public interface by default, rather than to much-safer private/localhost defaults. If you have an iptables INPUT DENY rule, it doesn't come into play at all, and that's certainly untuitive for people who aren't iptables experts. For example, if you're using ufw (which most non-power-users rely on) and have it set to DENY by default, that won't protect you from the example you provided. The way Docker works is simply wrong. It should not mess with iptables at all. It does so because that makes it "easier" for novice users, but that ease of use is a real security risk.
Re:Container networking is simple (2020) by still_grokking on Tuesday January 19, 2021 @11:25PM (#25842580)
> The way Docker works is simply wrong.

And that's not only the networking. Everything about Docker is like that. It's a mess. Don't use.

Re:Container networking is simple (2020) by mmgutz on Tuesday January 19, 2021 @05:52PM (#25840033)
Docker's custom iptables chains, upon restart of network or docker, can and most likely WILL clobber rules that used to work. Docker adds the DOCKER-USER user chain for the purpose of readding rules back after docker has set up its rules. Most engineers never have to deal with it unless they are deploying to production boxes.
Re:Container networking is simple (2020) by mauflows on Tuesday January 19, 2021 @02:07PM (#25837340)
I hope k8s (or some managed subset) eventually provides a stable networking abstraction. There is so much to consider when it comes to network hardening and I'd like it to not have to constantly stress about it, feeling like I don't know enough.
Re:Container networking is simple (2020) by Hackbraten on Tuesday January 19, 2021 @02:16PM (#25837507)
I think it’s time for us to get past “X is simple” or “X is easy.” It’s a highly subjective thing to say, no matter the topic. It’s never helpful, it just makes other people feel bad.
Re:Container networking is simple (2020) by iximiuz on Tuesday January 19, 2021 @02:47PM (#25837912)
Well, to be honest, some level of sarcasm was meant to be in this title because it precedes a 4000+ words explanation of the topic... But seems like I'm pretty bad at writing good titles. For sure I didn't mean to make anyone feel bad.
Re:Container networking is simple (2020) by a1369209993 on Tuesday January 19, 2021 @06:48PM (#25840603)
FWIW, I thought it was obviously either stupidity[0] or sarcasm based on the title, and the 4000+ words explanation confirmed it as the latter. Can't speak for anyone else, though.

Edit: 0: well, or lies / container vendor shilling

Re:Container networking is simple (2020) by Hackbraten on Tuesday January 19, 2021 @06:52PM (#25840646)
Appreciate the response. Thank you.