How to Use NetPlan in Ubuntu 18.04

Поділитися
Вставка
  • Опубліковано 4 сер 2024
  • In this video, I go over how to use NetPlan the new NetworkManager for Ubuntu 18+.
    New configuration files
    /etc/netplan/ (Yaml Files)
    sudo nano 01-netcfg.yaml (Make sure to Copy for a Backup)
    Configuring:
    network:
    Version: 2
    Renderer: networkd
    ethernets:
    DEVICE_NAME:
    Dhcp4: yes/no
    Addresses: [IP/NETMASK]
    Gateway: GATEWAY
    Nameservers:
    Addresses: [NAMESERVER, NAMESERVER]
    Where:
    -DEVICE_NAME is the actual device name to be configured.
    -yes/no is an option to enable or disable dhcp4.
    -IP is the IP address for the device.
    -NETMASK is the netmask for the IP address.
    -GATEWAY is the address for your gateway.
    -NAMESERVER is the comma-separated list of DNS nameservers.
    Generate Configuration:
    $ sudo netplan generate
    Applying Configuration:
    $ sudo netplan apply .
    ►► Digital Downloads ➜ www.cttstore.com
    ►► Reddit ➜ / christitustech
    ►► Titus Tech Talk ➜ / titustechtalk
    ►► Twitch ➜ / christitustech
  • Наука та технологія

КОМЕНТАРІ • 93

  • @MMWA.F
    @MMWA.F 5 років тому

    Dude thank you so much. I was using the old networking commands and was stuck for about a good 2 hours before your video. I had to make some minor adjustments but your video without a doubt pointed me in the right direction and saved me so much time.

  • @digitalsparky
    @digitalsparky 5 років тому +3

    I also really like netplan, the advanced stuff is also pretty simple to figure out as well.

  • @smibssmibs
    @smibssmibs 2 роки тому +3

    Great way to explain by showing mistakes in yaml formatting.
    Anyway, what looks great about the actual netplan:
    - single place to configure all the stuff
    - validates the configuration before it is really applied (and tells you, where is the error)
    - it builds on existing solutions (networkd or NetworkManager) making their use simple by providing unified configuration interface
    I like it.

  • @marmiz444
    @marmiz444 4 роки тому

    Super.W końcu ktoś konkretnie i na temat wytłumaczył co i jak i działa mi wszystko na Ubuntu 20.04.1 LTS

  • @mrshodz
    @mrshodz 4 роки тому +1

    Nice explanation. I like how you demonstrated how netplan works by breaking it.

  • @josephroblesjr.8944
    @josephroblesjr.8944 5 років тому

    I was just looking for how to do this and then you posted this! Than you!

  • @antiantiantiantiantiantian9766
    @antiantiantiantiantiantian9766 4 роки тому

    Thanks a lot! After struggling for hours with a malfunctioning network configuration (after cloning and migrating some VMs) Your video was quite an eye opener.
    Bad luck for me, that most google-search-results point to solutions referring to /etc/network/interfaces.

  • @AnzanHoshinRoshi
    @AnzanHoshinRoshi 5 років тому +1

    Thank you, Chris. Very useful video.

  • @nnaaaaaa
    @nnaaaaaa 5 років тому +8

    netplan is a dream for automation because now you can just push a yaml file and provision a bunch of servers' networking. BAM done.

  • @loukasmaki
    @loukasmaki 5 років тому +5

    OMG YES (I screamed when I saw the title and thumbnail for this video)

  • @reubenmartinez1
    @reubenmartinez1 3 роки тому

    Thank you for your tutorial. I found it very helpful in troubleshooting some issues I was having.

  • @HikariKnight
    @HikariKnight 5 років тому +3

    i configured netplan before in 18.04 for our server at my main job and i personally prefer it over the old method. personally i edit the yaml file with vim as i can set TAB to actually do 4 spaces instead :)

  • @desromic
    @desromic 4 роки тому +11

    5:50 Yay, I love playing "which of these invisible characters doesn't belong?" Netplan is fun for the whole family.

    • @mombof
      @mombof 4 роки тому

      This! You can probably do just a 30sec video only of the character formatting and call it "Ubuntu netplan sucks", and you'll probably have a million views in a week ;) many people are trying to sort it out the first time and struggling with tabs.

  • @Dmac4362
    @Dmac4362 4 роки тому

    Thank you for clearing this up for me

  • @Speccy48k
    @Speccy48k 5 років тому +8

    Hi, a tutorial with a Wifi interface would be great 😉

  • @zia.rehman
    @zia.rehman 4 роки тому

    This is the best example I have came across

  • @Sukeml
    @Sukeml 5 років тому

    I love it's great for my setup, with qemu and unifi vlans.

  • @barts3o
    @barts3o 3 роки тому

    Thanks a lot! Finally it's working!

  • @dexterlowery1472
    @dexterlowery1472 3 роки тому

    Thanks for including those common errors towards the end.

  • @ichimokustrategy9132
    @ichimokustrategy9132 3 роки тому

    It works! Thank you

  • @jim8395
    @jim8395 5 років тому +1

    Great video, I love you showed the errors and then fixing them. More realistic when learning and new things.

  • @jig1056
    @jig1056 4 роки тому

    I like it.. thanks.. really nice and informative video

  • @ImHereForPearlJamVid
    @ImHereForPearlJamVid Рік тому

    this is the way. thank you.

  • @rasindunimsara6643
    @rasindunimsara6643 3 роки тому

    problem solved! thank you.

  • @motsgar
    @motsgar 4 роки тому

    As a new guy to linux, i think that this is awesome

  • @GiancarloCarccamo
    @GiancarloCarccamo 5 років тому

    Great video.

  • @sunealsblbrandt436
    @sunealsblbrandt436 4 роки тому

    thanks uncle chris

  • @LampJustin
    @LampJustin 5 років тому

    You should try out the micro editor ;) It's a nice replacement for nano!

  • @ngebolangria1060
    @ngebolangria1060 4 роки тому

    Hi Chris, is there a way to factory reset the network configuration in ubuntu? I've messed up the netplan config and since then I can't connect to internet, even after i tried to revert it back (I didn't take a precaution to backup old yaml file). Many thanks

  • @hattan6775
    @hattan6775 4 роки тому

    I have one question now I have in my laptop hard drive and SSD ok now when I download photos or applications where it will save in the hard drive or SSD or both will be mixed I want to know because I want to organize everything I tried but I could not its not like windows

  • @kjakobsen
    @kjakobsen 5 років тому +15

    Netplan and YAML makes my blood boil. I ended up circumventing Netplan, and use the interfaces below.
    The strict formatting insanity alone, what kind of masochist would you have to be, to come up with that?

    • @mikemockler2079
      @mikemockler2079 3 роки тому +1

      Could not agree with you more. I'm sure it works better for scaling up automated configuration of large-scale deployments but I just want to configure a single damn server, where is my nmtui?!
      Obviously I know you can install and change that but I'm studying for LFCS and don't want to waste time.
      Anyway sorry to necro a year old comment but damn it's making me angry.

    • @francisphillipeck4272
      @francisphillipeck4272 Рік тому

      Absolutely. Even copy/pasting config samples form netplan's own documentation and filling in your information DOESNT EVEN WORK meaning their OWN documentation is worthless!!!!

  • @danimoosakhan
    @danimoosakhan 4 роки тому

    What is cloud-init. Is that need to be disable before making change to yaml file?

  • @yovvel
    @yovvel 3 роки тому

    Why use netplan generate? Netplan apply also check for errors before applying the changed yaml file? Just asking out of curiousity

  • @adibsadman4094
    @adibsadman4094 5 років тому +1

    Hi Chris. Great video!! Would like to know what distro you use.
    Cheers

  • @unpaintedcanvas
    @unpaintedcanvas 5 років тому

    Coming from someone who's slowly but surely going to configure an old laptop to become a nextcloud server, this seems really promising.
    I just really hate nanoing into yaml files for the reasons described though. Or really any file that relies on "tabbing" for that matter. Constantly have to fight myself.

  • @rafaeloliveira2740
    @rafaeloliveira2740 5 років тому

    Hi! I'm having big trouble trying to configure a bond of two interfaces in ubuntu. Can you make a video showing that configuration?

  • @s9209122222
    @s9209122222 5 років тому +2

    Is it a different version of ifconfig? Is NetworkManager the same thing?

    • @nnaaaaaa
      @nnaaaaaa 5 років тому

      it's a shim that generates NetworkManager and/or systemd-networkd configs

  • @benriful
    @benriful 5 років тому +1

    Yeah Yaml's got the same issue as Python, "tab" is a bad idea.
    BTW, you can configure nano to auto convert tabs to spaces for you. Make a .nanorc file in your home folder and place the following lines into it:
    set tabsize 4
    set tabstospaces
    Alternatively create an alias for nano to include the commandline parameters: nano -E -T 4
    I'd actually go with the alias idea and give it some other name, so I can use nano in "yaml / python" mode, while for other stuff I can still use tabs if I want.

  • @FritsvanDoorn
    @FritsvanDoorn 2 роки тому

    Ok, but now, there is this pc with two interner cards. One connected to the world using dhcp, easy, but the second is connected to multiple vlans with all different fixed addresses. Four different addresses per vlan, so the card has multiple addresses. How to do that?

  • @VulcanOnWheels
    @VulcanOnWheels 4 роки тому +2

    If you would have used vim, you could have entered an instruction to search your file for tabs and replace all of them with 4 spaces.

  • @SwiatLinuksa
    @SwiatLinuksa 5 років тому

    Network Manager give me many many issues with WiFi USB dongle ( Realtek and atheros ), in Ubuntu, Centos and Arch.. Starting from don't connect to WPA2 Network, loosing connection or just don't show device. Turn off that, manually configure wpa supplicant , then dhclient/dhcpcd resolve all problems..

  • @omemester6985
    @omemester6985 3 роки тому

    How am i supposed to configure an ip range for my dhcp server?

  • @davelionneltemga6218
    @davelionneltemga6218 3 місяці тому

    Can someone explain me why my VMs on KVM Ubuntu 18.04 are getting just 70M/s upload out of the 900M/s that I got from my ISP please?

  • @419sinbad
    @419sinbad 5 років тому +3

    Hey Chris u don't know how difficult it is but could you do a video on how combine two network for higher speeds I think you mention network bonding. Thanks

    • @ChrisTitusTech
      @ChrisTitusTech  5 років тому +2

      Certainly, I'm about to bond a couple nic's on some servers I have aquired.

  • @gaiusbaltar7122
    @gaiusbaltar7122 3 роки тому +1

    To make it the easy way, go to /usr/share/doc/netplan/examples and make a copy of static.yaml to /etc/netplan then, put the right values in it, and you're good to go.

  • @miveliino
    @miveliino 5 років тому +1

    If you forget the sudo, you can just use "sudo !!" it will fill in the last command.

  • @slash1498
    @slash1498 5 років тому

    could you change your lights ...

  • @teddraper1746
    @teddraper1746 5 років тому +2

    What's the advantage of a static IP address vs one that is varable?

    • @ChrisTitusTech
      @ChrisTitusTech  5 років тому

      Port forwarding is the main purpose and file sharing in a lan.

    • @teddraper1746
      @teddraper1746 5 років тому +1

      @@ChrisTitusTech good to know. I host old school LAN parties so I'll have to put this practice to use...but I use Arch, not Ubuntu. Is there something similar in Arch?

    • @ChrisTitusTech
      @ChrisTitusTech  5 років тому

      Yes, but it can be setup different ways. Typically it is done using NetworkManager, but some people leave the default systemd dhcpd in place and that is configured differently. So it just depends on how you setup your arch.

    • @javabeanz8549
      @javabeanz8549 5 років тому +1

      If you run your own DHCP server, or your router allows reservations, you can assign specific IPs to specific MACs, that might be an easier way to deal with LAN parties.

  • @bossak.mokpokpo
    @bossak.mokpokpo 3 роки тому

    hi , how do i put the syntax dns-nameserver and dns-search in the config?

    • @gaiusbaltar7122
      @gaiusbaltar7122 3 роки тому

      There is a file in /usr/share/doc/netplan/examples called static.yaml that you can use and make fit your needs.

  • @mon0theist_tv
    @mon0theist_tv 4 роки тому

    the war between tabs and spaces rages on
    But yeah this seems like one of those things that definitely didn't need to be changed. Not sure why Canonical came up with this.

  • @BruceBigby
    @BruceBigby 5 років тому

    Why did you enter [0.0.0.0,1.1.1.1] as a name server address value?

    • @javabeanz8549
      @javabeanz8549 5 років тому

      it wasn't 0's it was 8's Google's public DNS runs on 8.8.8.8 and 8.8.4.4 on IPv4

  • @sekt1953
    @sekt1953 5 років тому

    yes that was the easy part, what about the auto-discovery setup so we do not need fixed ip addresses

  • @iharvalianski7843
    @iharvalianski7843 4 роки тому

    How to bond local DNS server to Ubuntu 18.04 ?

  • @myprovideo7852
    @myprovideo7852 4 роки тому

    I do not get what the google address has to do with anything?

  • @chind0na
    @chind0na Рік тому

    I switched routers and this headless server kept losing the settings/ or I was not saving them hehe. Just applied dhcp=false and rebooting...... let us see if we have the same IP as before. A minute later And it is. Gracias.

  • @layer8371
    @layer8371 5 років тому

    Witch Distro u use under the VM?

  • @imranmanan7346
    @imranmanan7346 Рік тому

    3 years later i'm still referring to this video

  • @papabones8753
    @papabones8753 5 років тому +1

    While you're on the network trip: do a video on wifi in live-cds via wpa_supplements and the likes. I've recently used my laptop as my test machine for all sorts of things(due to having to reinstall) and I've had mixed results with wpa_supplements. I got it working with gentoo and the likes but had a lot of issues with it on other distros like arch(based) ones and void for some reason. Might be useful to someone.

    • @loukasmaki
      @loukasmaki 5 років тому +1

      This has worked for me on Arch:
      (must be run as root) wpa_supplicant -B -i interface -c

  • @SY1337
    @SY1337 4 роки тому

    stuff like this is what drives people to use *BSD instead. What were they thinking? Hm.. what would be the most complicated way for the average user to set up their network configuration?!..

  • @jytan740
    @jytan740 4 роки тому

    i need to learn a new syntax its also space and tab sensitive

  • @zl0y
    @zl0y 4 роки тому

    in short, who did not understand! in the yaml file do not use the tab key, only spaces!
    короче кто не понял! в файле yaml не используйте клавишу таб, только пробелы!

  • @MrGFYne1337357
    @MrGFYne1337357 5 років тому +4

    Yay, linux for breakfast.

  • @sleepychildkungfu
    @sleepychildkungfu 4 роки тому

    got to 7:39 and I am tapping out

  • @xanosdarkpaw1
    @xanosdarkpaw1 5 років тому

    Netplan!!! *shakes fist*

  • @Booming-letsplays
    @Booming-letsplays 5 років тому

    Weird video. Did you install Arch drunk and this is the result?

  • @francisphillipeck4272
    @francisphillipeck4272 Рік тому

    Man netplan and ubuntu server is a absolute nightmare, ubuntu's documentation is, dwell non-existant and netplan's own documentation isnt even correct or working. I just get syntax error after error after error, ive been messing with this server for weeks and im just fucking over it bro this is easily the worst os ive ever used in my entire life.

  • @zl0y
    @zl0y 4 роки тому

    netplan is the most annoying in new ubuntu

  • @Kukkane
    @Kukkane 4 роки тому

    Routes😏💡updates. 🤦‍♀️🤷‍♀️🇦🇶

  • @williamheckman4597
    @williamheckman4597 4 роки тому

    "its not that bad... " Means... not that good.

  • @HentaiNat
    @HentaiNat 4 роки тому

    I still hate it

  • @kittel-dev
    @kittel-dev 3 роки тому

    I don't like netplan! Sorry!

  • @HentaiNat
    @HentaiNat 3 роки тому

    I still hate it