Docker Networking Tutorial, ALL Network Types explained!

Поделиться
HTML-код
  • Опубликовано: 28 ноя 2024

Комментарии • 249

  • @esra_erimez
    @esra_erimez 3 года назад +74

    Okay, watching this at normal speed!

    • @BenReese
      @BenReese 3 года назад +2

      😂 I listened at 2x while vaccuming, but will definitely have to review again later for the mac/IP vlan stuff.

    • @tmagrit
      @tmagrit 2 года назад

      Totally 🤣

    • @SitarHero28
      @SitarHero28 2 года назад +1

      I thought I was in 2x speed lol.
      This dude knows his stuff.

    • @ivandrofly
      @ivandrofly 7 месяцев назад +2

      I nearly reach the speed of light when speeded to 2x

    • @esra_erimez
      @esra_erimez 7 месяцев назад +1

      @@ivandrofly 🤣

  • @c-pup
    @c-pup 2 года назад +33

    Yet another great video! I've recently been struggling setting up two piholes on the same host and your explanation of macvlan was 1000% times more concise than every other forum that I've read through over the past couple days. Keep up the great work! Liked and subscribed!

  • @D3M0320
    @D3M0320 3 года назад +12

    Your videos are absolutely fantastic!! I used some of your tutorials to stand up docker / portainer on my raspberry pi to self host some things without having a potentially power hungry and noisy desktop running 24/7. I greatly appreciate the time you take to provide these wonderful videos!

    • @christianlempa
      @christianlempa  3 года назад

      Thank you so much! I'm glad you like the videos :)

  • @thegrimreaper156
    @thegrimreaper156 Год назад

    I spent probably 3h figuring out how to assign another external IP to a Bind9 container, doing a lot of research and trying with ChatGPT.
    Found your video, solved in 5min !!!

  • @datpspguy
    @datpspguy 2 года назад +1

    i'll be completely honest, i was literally thinking about this and probably mentioned it out loud near my computer and "boom" this was in my homepage waiting. I was trying to figure out if I should build a lab using containers w/ static IP's or just use Virtualbox in bridged mode so this really helped me.

  • @PeterBatah
    @PeterBatah 11 месяцев назад +1

    I created a docker instance in VMWare ESXi and proceeded to follow your instructions. I could not get past the part where I assigned the newly created macvlan to an nginx container for example. The fix was to configure "Promiscuous Mode set to Accept" in my VMWare network settings. In case anyone should run into the same issue. Thank you for sharing Christian. Much appreciated as always. All the best in 2024.

  • @jayp9158
    @jayp9158 Год назад +3

    Incredible video. I’m currently binge watching your channel and I’m amazed by the the quality of all your content. Keep it going man, you are great!

  • @axreds
    @axreds 2 года назад

    even if the video is 1 year old it made my day!!! Thanks Chris very clear and well done

  • @rathio7662
    @rathio7662 3 года назад +1

    Hello Christian,
    your videos are great, from my side perfect to understand. Please stay tuned, I learned so much.

  • @HiltonT69
    @HiltonT69 3 года назад +5

    This is a great, clear and concise explanation of these different network types. :)

  • @FinbarrAherne
    @FinbarrAherne 2 года назад +4

    This is exactly what I was looking for! Thank you for the clear and concise explanations for all the different network configs, and also for stepping through each.

  • @HideBuz
    @HideBuz Год назад +2

    Finally somebody who explains that stuff clearly and without jargon! Thank you so much for your contributation!

  • @oppailover3087
    @oppailover3087 Год назад

    Thank You man! I was just randomly watching this video and figured out how to solve port 53 issue for pi-hole in docker

  • @jeytis72
    @jeytis72 3 года назад +4

    Great job, Christian. Very clear and informative... as always. Thanks

  • @jakedeng2288
    @jakedeng2288 2 года назад

    very useful video, I solved one of my docker issues right after watching this!

    • @christianlempa
      @christianlempa  2 года назад

      Thank you! :) Glad you could solve some issues with it!

  • @xcaptz
    @xcaptz 3 года назад +3

    So amazing, this video saves me a lot of research 🧐. Well, thanks a lot bro!

  • @derBerg
    @derBerg 3 года назад +1

    VIelen Dank! Ich kann nicht verstehen, wie Menschen hier downvoten..
    Very interesting! As a guy having a new job in IT as a career changer i need to close alot of knowledge gaps of stuff which seems to be common sense in IT. I like your style!

  • @alex.username
    @alex.username 10 месяцев назад

    What a concise, well structured and informative video!

  • @dakzer55
    @dakzer55 2 года назад

    Thank you for this refresher on docker networking. Has fixed my issue with trying to get HADR for Sql Server instances running in docker

  •  3 года назад +8

    "Who needs swarm?'" everyone who wants a simple cluster running one command "docker swarm init"

  • @umarchy
    @umarchy 2 года назад

    Nice video cristian. The explanation was concise. Just learned about the macvlan through your video. Thanks.

  • @mal-avcisi9783
    @mal-avcisi9783 Год назад

    this guy knows his shiat. bravo !

  • @Ellyll
    @Ellyll 2 года назад

    This video was really helpful for me to get a nice quick understanding of docker networking, thank you!

  • @yoddy0
    @yoddy0 Год назад

    Thanks for the insight on the various network drivers on docker. I blindly used a macvlan from a tutorial for pihole but wanted to understand how it works.

  • @localadm
    @localadm 3 года назад +3

    this is very good stuff, well explained. going to check that with dockerized pi-hole or adguard. thanks a bunch!

  • @Error_404-F.cks_Not_Found
    @Error_404-F.cks_Not_Found 3 года назад

    Best docker video i've watched. Super informative.

  • @konsti300
    @konsti300 3 месяца назад

    Thanks for explanation of Host Network. Your my Man, you saved my Day/Night :)))

  • @NetanelZZZ
    @NetanelZZZ 2 года назад +1

    That search-result seemed to be the answer to all my problems; I'm running PhotonOS ( docker environment for ) on my ESXi and just cannot figure that out. I cannot ping the host, nor does it seem like it got to talk to my router ( according to the devices list ).
    How should I debug this?
    I tried to enable promiscuous mode for the vmswitch but it is still not working.

  • @zuberkariye2299
    @zuberkariye2299 3 года назад +1

    I am into 4 mins in the vid now, and I love it already, I am just learning docker and I never thought that docker could have a network(IP) since it runs on top of the OS. Gonna add this to my list of docker reference in the future.

  • @lpfigue
    @lpfigue 3 месяца назад

    Thanks a lot. I'm using syncthing in docker and the connection was always over relays. Using the host network driver solved the problem and now is over tcp lan.

  • @rapha5586
    @rapha5586 3 месяца назад

    Nice video!! Am considering to use vlans of my router rather than a custom docker network to seperate dockers / services from each other. But I wonder that the benefits of that really would be? I can use the firewall for more granular interlan access rules but would also increase the load my firewall. Appreciate any insights ❤

  • @RamiKattan
    @RamiKattan 11 месяцев назад

    Nice tutorial, I knew a lot about networks in docker but learnt a couple of things, including the netshoot container, very useful.
    Something that was not mentioned: macvlan containers can't reach bridge containers with their internal IP address (172.16.x.x), they can only reach the host ip and port, is this correct?
    I created a traefik container and bound it to macvlan to make it get a distinct IP address, but it was unable to reach any container until I added a second network for traefik on the bridge network.

  • @rrr92462
    @rrr92462 Год назад

    Excellent video. Great examples and explanations.

  • @fbifido2
    @fbifido2 3 года назад +1

    1. Can you modify the default bridge (name, ip, subnet, type) ?
    2. When you create a custom network, how do you tell it what type to create, ip-range, subnet, etc...
    3. Type shown: Host, Bridge, Null?, macvlan, ipvlan. Are there more ?
    4. Can you change the default bridge that docker use for new containers?
    5. Can any of these network do dhcp ip reservation using mac-address, or support static ip-address?
    6. Does any of the network support ipv6, default seems to be ipv4?

  • @thomasreedy4751
    @thomasreedy4751 14 дней назад

    Great explanation. I noticed a lot of people say you shouldn’t make the macvlan ips static … or at least minimize the static ips.
    Are the only required static IPs you would need be a reverse proxy manager and a recursive DNS server?
    You should be able to reference the host/container name in the proxy instead of an IP if the container is on the same network.
    However the dns server will require an IP for the reverse proxy and the recursive server.
    Is there another way?

    • @christianlempa
      @christianlempa  13 дней назад +1

      I think it really depends on the setup. For services like a reverse proxy, DHCP or DNS, static IPs are always recommended. I don't know why you should avoid static IPs?

  • @ErickWarden
    @ErickWarden Год назад

    Earned a subscriber with this one!! This helped me fix my Docker home assistant network problem!

  • @giovannipetroselli6103
    @giovannipetroselli6103 3 года назад

    Very clear and precise. All your videos are amazing. Thanks Cristian!

  • @jmtfreelancer4473
    @jmtfreelancer4473 2 года назад

    Hello, Your video is what i needed . But I woul dlik eto do the same on MAC OSX . what is the solution to have two static IP on my HOST OSX?

  • @stevefxp
    @stevefxp 2 года назад

    I am a tech professional of over 35 years and I am learning Docker on my own. I understand networks well but in beginning to think about how I want networks deployed.
    I would prefer having a subnet that is container only. If I did this would I still use bridge or macvlan driver?

  • @mdawas1986
    @mdawas1986 11 месяцев назад

    Hello Christian,
    Many thanks for the video
    where is the cheat sheet located, I visited your github and I cant find it, seems you have changed the location since your video
    hope you can share link
    thanks

  • @GlenMillard
    @GlenMillard 2 года назад

    I just started watching and I hope this lands nicely! You sound exactly like 'Klaus' on 'American Dad'
    I love the show, by the way.
    Now I'm going to watch your video!

  • @xseman
    @xseman 2 года назад

    simple explanation even with examples, great stuff!

  • @psicodelico6
    @psicodelico6 3 года назад

    Greetings from Argentina

  • @lakshminarasimmanv
    @lakshminarasimmanv 2 года назад +1

    it would be helpful if you can make a dedicated video on overlay networks and try to install Traefik and Portainer in swarm mode.

  • @radiowolf80211
    @radiowolf80211 Месяц назад

    Thanks for the video! I needed this one.

  • @davidsomething4867
    @davidsomething4867 Год назад

    Just getting started with docker and loving it. One thing I am struggling with is getting IPvLAN L2 working with fixed IP addresses through compose when the ipvlan already exists on the host, jus seem to get one error after another when specifying the existing network. I've got multiple USB interfaces on a debian instance loaded on a PC and am using IPvLAN as alternative to macvlan and having to setup promiscuous mode although I have macvlan 802.1q working on another host so I have no issue with the concept and have a good understanding of networking as a whole. I've setup an ipvlan with fixed addresses for a ipam container with a separate container for the database and this works no problem but I had to setup the containers the old fashioned way.

  • @TheLaelkrol
    @TheLaelkrol 2 года назад

    How can I make my container use a specific interface on a host system i.e. I have one cable connection and two wlan interfaces and I've got 3 containers. I'd like each to use a dedicated interface. Which type of network will be best and how would I go about it?

  • @MahmudDomili
    @MahmudDomili 11 месяцев назад

    i just follow the tutorial here using macvlan
    but i cant ping the gateway or the internet from netshoot container using macvlan
    is it okay to running the macvlan inside hyper-v ?
    Bare Metal ( Windows Server ) > Hyper-V ( Ubuntu Server ) > Ubuntu Server ( Docker )

  • @victoryosikwemhe2280
    @victoryosikwemhe2280 2 года назад

    Nice. Just a quick question, if we can ping a device (in a macvlan network) from another device in a spearate network, why is the scope local?

  • @syetrack3374
    @syetrack3374 8 месяцев назад

    I have multiple public static ip on host interface but I can't figure out how to use each of them on separate containers for docker. When I run a container its assessable by every public ip I have

  • @HewaSaleem
    @HewaSaleem 2 года назад

    Moin Moin,
    Best explanation ever! keep up.

  • @sposada00
    @sposada00 Год назад

    Im having an issue with the macvlan. I can ping the containers from my home computer but i cant get a response from the gateway. I am running virtual box for my machine and i have promiscuous mode on. I have been troubleshooting but cant seem to get it to have connectivity to outside the network

  • @SebastianMBraun
    @SebastianMBraun Год назад

    What ist your terminal you use in 17:19? I like it!

  • @pierrer3109
    @pierrer3109 2 года назад

    Thanks ! Great explanations. Have a nice day

  • @josel82
    @josel82 2 года назад

    Really good video. Very well explained and well produced. You got yourself a new suscriber 👍🏽

  • @mikekane9734
    @mikekane9734 2 года назад

    Interesting! What type of network should I use for my home server setup and run containers behind wireguard client for my torrenting?

    • @christianlempa
      @christianlempa  2 года назад

      Depends on if the wireguard is in docker as well or not.

  • @RockTheCage55
    @RockTheCage55 10 месяцев назад

    Hi Christian this has been excellent. When you created the macvlan why did you specify it on a different subnet '/32'?

    • @christianlempa
      @christianlempa  10 месяцев назад

      thank you! :) subnet /32 basically means "1" address

  • @SayantanKumarBasu
    @SayantanKumarBasu 8 месяцев назад

    Are there any limitations for Windows Host?

  • @yaroslavozerov1121
    @yaroslavozerov1121 Год назад

    Bro! Thanks for the video, but the biggest thanks for picture on your t-shirt! I had such poster on my wall in 90th! That's awsome))

  • @zhitoooo
    @zhitoooo Год назад

    short, useful , great, awesome thanks alot

  • @ivandrofly
    @ivandrofly 7 месяцев назад

    4:21 - DNS limitation by using the DEFAULT bridge network
    10:51 - mentioned about PI-hole (adguard like) issue

  • @sonalkumarjha5200
    @sonalkumarjha5200 2 года назад

    @admin can you please upload a solution video for issue "use of closed network connection" while pushing large to docker hub.

  • @jslegers1973
    @jslegers1973 Год назад

    Thank you Christian for this great explanation. I do have a question is it possible to have a container in two networks? I'm trying to create a compose file with PiHole and Unbound. The Pihole has a macvlan for my network and also a bridge to communicate to unbound. But every time I want to compose it the bridge network on the PiHole gives an error Cannot start service pihole: No available addresses on this pool. IS it even possible to create a container in two different networks?

    • @christianlempa
      @christianlempa  Год назад

      Thank you! :) It's possible to add a container to more networks, but I'm not sure how that works with a macvlan.

  • @cloud2050
    @cloud2050 2 года назад

    Great video! You cleared up my confusion on docker network. BTW! What are you using to show the AD block statistics in your browser startpage?

  • @rshnthms
    @rshnthms Год назад

    Can this fix below problems,
    How have docker without docker desktop so that I have 2 containers service [django and nginx] which share a network also in the host [wsl2 Ubuntu] mysql is installed.
    How to connect django and mysql, django and nginx?
    Does macvlan or ipvlan slove it?

  • @FabianoChagas
    @FabianoChagas Год назад

    Awesome as always! Thanks for sharing

  • @brandoneadie8566
    @brandoneadie8566 2 года назад

    I'm trying to figure out how to use my 5 external public ip addresses, and have my router see lets say 5 containers from docker. Which I would give each one its own external public ip address. Would you have any idea how to achieve this?

  • @Eratzer
    @Eratzer Год назад

    Thx macvlan is what i needed for some containers

  • @paulkalus41
    @paulkalus41 2 года назад

    Hi Cristian, this is a another great video. The Macvlan part is something I've been searching and searching for, always coming to a dead end. The way you have explained and demonstrated it is spot on and has solved my issues, and I've actually learned something! :)

  • @dpicollege
    @dpicollege 2 года назад

    I have two docker machine on same host one on overlay network of swarm and another one is on bridge network so which rules for my iptables or route i should write that my both container can communicate each other?

  • @keleitangpusen1560
    @keleitangpusen1560 2 года назад +1

    Hi, can macvlan take effect in the virtual machine, after I configure macvlan in the VMware virtual machine, the container cannot ping any ip or even the host

    • @thulasiramteja8581
      @thulasiramteja8581 2 года назад

      which os did you use for hosting??

    • @keleitangpusen1560
      @keleitangpusen1560 2 года назад

      @@thulasiramteja8581 Ubuntu

    • @thulasiramteja8581
      @thulasiramteja8581 2 года назад

      @@keleitangpusen1560 please try with CentOS 7 using command
      Sudo ip link set enpos3 promisc on and it worked
      But in CentOS 8 and Ubuntu 16.04 above the command didn't works still i didn't get the solution but try on CentOS 7 the ping will work

    • @thulasiramteja8581
      @thulasiramteja8581 2 года назад

      And also turn on promiscuous mode "allow all" in bridge mode in vbox settings

  • @AnythingGodamnit
    @AnythingGodamnit Год назад

    Loved this, thank you. I now feel like I have the knowledge to solve my current Docker networking problem - excited to try!

  • @39zack
    @39zack Год назад

    setting up an reverse proxy is easy enough, but how do you setup "client-containers" behind the proxy that can only access the outside though the proxy?
    I guess if you set up the other containers on the same network as the proxy or an vlan network, they have direct access to the outside network
    If this was physical machines or VMs, I would just have put 2NICs on the proxy machine but no clue if this is possible on dockers or if that is how you do it

  • @majidalikhanquaid984
    @majidalikhanquaid984 2 года назад

    Clear and too the point, that's what I was looking for !! Thank you so much

  • @onehumanwasted4228
    @onehumanwasted4228 2 года назад

    How can I run netshoot out of Portainer? It immediately stops itself after cration/starting

  • @christofferahlback
    @christofferahlback 10 месяцев назад

    Great video! Thanks! I’m on a mac and have had a gard time getting ipvlan to work over the wifi. As for now, I just need some containers for development tools (web dev) and would really like to get their own ip-numbers rather than running them as localhost… seems like it’s not as easy on Mac OS as in Linux at the moment. Any ideas? Cheers!

    • @christianlempa
      @christianlempa  10 месяцев назад +1

      hmm I've not tried it out unfortunately, only used it on linux

  • @sbkpilot1
    @sbkpilot1 Год назад

    Great video! One thing I noticed is that in WSL2 with Docker Desktop the behavior is rather different - when you create a new bridge network there is no interface created. I wonder how it works in this case.

  • @EvolverDX
    @EvolverDX 2 года назад

    If you create a mcvlan and attach a container, the Host no longer can access the container, but all clients on your network can. I had to create a bridge for the macvlan and specify the ip routes for the host to that container.
    I encountert this problem as I deployed pi-hole in my network, and specified in the settings of my DSL-router this pi-hole container as a network wide DNS-Server.
    All clients were able to resolve the new DNS-Server, but the rest of the docker containers and the docker host himself were no longer able to reach this IP (even though they were on the same subnet), so the host was not able to perform updates anymore (no DNS resolution).
    Is there a 'nice and shiny' solution I didn't catch, a better way to solve this issue or a best practise way to handle those kinds network things? What would be your attempt?

    • @francocastilloAR
      @francocastilloAR Год назад

      It is supposedly to create a macvlan "subinterface" on the host so that it is at the same "tier" as the containers.

  • @GlenMillard
    @GlenMillard 2 года назад

    Now I have watched your video - it was very informative. Thanks much for this. Much appreciated! 😎😎

  • @wstrater
    @wstrater 2 года назад

    How about a video on Docker DNS? Seems to be biting me quite a bit lately. I can access other containers but fail when accessing external sites such as Let’s Encrypt.

  • @songokussj4cz
    @songokussj4cz 2 года назад

    Wow, didn't k ow about macvlan. So it's possible to run both Traefik (for docker apps) and Nginx (for non-docker apps to reverse proxy) at once so that both listen to port 80?

  • @mr.wayfarer6082
    @mr.wayfarer6082 2 года назад

    Much appreciated, sir. Home Assistant and Plex containers conflict listening the same 1900 port while running on bridge connection fe

  • @coolglass6672
    @coolglass6672 2 года назад

    Great videos dude! can i ask why Owasp says we should set ICC to false? I am guessing they just mean they want us to use custom networks?

  • @tech-networking9287
    @tech-networking9287 2 года назад

    why my terminal doesn't show anything when I typed ip a | grep docker0, I don't have docker0?? Someone knows what's going on?

  • @rupam.mandal
    @rupam.mandal Год назад

    A couldn't connect to the IP of a macvlan container from the same machine in which the docker is hosted. However it can be accessed from other machines in the network. Is there anything that can be done?

    • @EzekielPrellus
      @EzekielPrellus 11 месяцев назад

      Yes, create a macvlan bridge on the host, linked to the host's interface, then add one or more routes for that new bridge for the subnets that are in use by the containers. You will be able to ping host-to-container and vice versa.

  • @EmilioAyala
    @EmilioAyala 2 года назад

    do you have a color preset? loving the purple on black.

    • @christianlempa
      @christianlempa  2 года назад +1

      Yes, I have it for Windows terminal on my github Repo dotfiles-win

  • @yaserghananwi
    @yaserghananwi 2 года назад

    Hi
    nice tutorial , i true to check network interface but there is no docker0 bridge on macOS
    BR

    • @christianlempa
      @christianlempa  2 года назад

      I think that was changed in some version of docker but I’m not 100% sure

  • @annahri
    @annahri 3 года назад

    You can just drop grep and use `ip a ` instead

  • @John._.T
    @John._.T 2 года назад

    Really informative. Just stumbled on to your channel. Fast paced and great information. Just managed to keep up as I'm completely new to docker. Subscribed to your channel. Thanks 🙂

    • @christianlempa
      @christianlempa  2 года назад +1

      Thank you! Hope you find some useful stuff here :)

  • @anikrahman9871
    @anikrahman9871 2 года назад

    Your video is fantastic

  • @okoeroo
    @okoeroo 3 года назад

    Excellent explanation

  • @fbifido2
    @fbifido2 3 года назад +1

    1. Can all containers in a Null network see each other?
    2. Can a single container connect to multiple networks?

  • @ahmedmimo9274
    @ahmedmimo9274 2 года назад

    I'm on ubuntu 22.04 I can't see docker0 network when running ip a command,

  • @liquidintegrity
    @liquidintegrity 2 года назад

    Wow. Just wow. Thank you!

  • @fahadnaif2170
    @fahadnaif2170 3 года назад

    Can you please explain the CNI and CSI, differences like for example CNI’s Flannel, calico,, etc. Thanks.

    • @christianlempa
      @christianlempa  3 года назад +1

      That's unfortunately a topic where I have NO experience at all :D Maybe in the future.

  • @jameshunt5184
    @jameshunt5184 2 года назад

    Awesome video, really liking your content 🔥 I was wondering if you could help clear up something. In portainer I'm able to change the network of a container to 'container' mode that allows me to run containers through another containers network. In my case I run containers through a VPN container. However how is this done in a Docker compose file?

  • @need5868
    @need5868 2 года назад

    How to stream iptv channels using server and get url link Nginx ? just for learn

  • @_Dhruv-nj8dk
    @_Dhruv-nj8dk 2 года назад

    Could someone tell me how to create a custom bridge network in an AWS ECS task definition, without using docker-compose?

  • @fbifido2
    @fbifido2 3 года назад

    - @3:41 what is the number in-front of the docker0: network?
    "6: docker0: "
    - the "###: vethxxx@if(###-1):" is virtual ethernet interface, can the route command work with them?

  • @cjntrade4717
    @cjntrade4717 2 года назад

    Awesome brother