< Return to Video

Linux - Network Configuration (ip, route, dhclient, systemd-resolve, netplan)

  • 0:00 - 0:03
    please go to Eli the computer guy calm
  • 0:03 - 0:06
    in order to view schematics code and
  • 0:06 - 0:08
    more for the projects that you are
  • 0:08 - 0:11
    learning about welcome back so today's
  • 0:11 - 0:13
    video I'm going to show you basic
  • 0:13 - 0:16
    networking configurations on an a Linux
  • 0:16 - 0:18
    server now I will warn you with this
  • 0:18 - 0:20
    particular video this might be one to
  • 0:20 - 0:22
    make your brain hurt a little bit and
  • 0:22 - 0:27
    that's okay that's okay when you start
  • 0:27 - 0:28
    trying to explain how networking works
  • 0:28 - 0:31
    in the Linux world we get into one of
  • 0:31 - 0:33
    the big issues where this should not be
  • 0:33 - 0:35
    that complicated of a subject but
  • 0:35 - 0:37
    because there are so many distributions
  • 0:37 - 0:39
    there are so many versions there are so
  • 0:39 - 0:41
    many ways of doing any one thing in the
  • 0:41 - 0:44
    Linux world when you get something basic
  • 0:44 - 0:46
    as basic as simply managing your IP
  • 0:46 - 0:49
    addresses that can get a little bit more
  • 0:49 - 0:50
    complicated again remember when we're
  • 0:50 - 0:52
    talking about Linux we're really talking
  • 0:52 - 0:54
    about good new Linux what we mean by new
  • 0:54 - 0:56
    Linux is Linux is the kernel and then
  • 0:56 - 0:58
    literally everything else within the
  • 0:58 - 1:00
    operating system is something that is
  • 1:00 - 1:02
    added on and so one of the issues that
  • 1:02 - 1:03
    you run into is again depending on the
  • 1:03 - 1:05
    version depending on the distribution
  • 1:05 - 1:07
    depending on a lot of different things
  • 1:07 - 1:09
    you may be using different tools to be
  • 1:09 - 1:11
    able to manage your networking services
  • 1:11 - 1:14
    on your particular Linux system so while
  • 1:14 - 1:16
    you're watching this video and I'm
  • 1:16 - 1:18
    showing you these demonstrations just
  • 1:18 - 1:20
    kind of keep this in mind so I'm using a
  • 1:20 - 1:24
    bun to 18 point oh four point three
  • 1:24 - 1:26
    LTS server version four when I do these
  • 1:26 - 1:28
    demonstrations so if you're using Ubuntu
  • 1:28 - 1:30
    if you're using any rather modern about
  • 1:30 - 1:31
    two everything that I show you today
  • 1:31 - 1:34
    should work but if you're using a Linux
  • 1:34 - 1:36
    distribution and what I show you today
  • 1:36 - 1:38
    doesn't work well then you may just have
  • 1:38 - 1:40
    to go off and do some google searching
  • 1:40 - 1:41
    again that's one of the problems of the
  • 1:41 - 1:43
    Linux world things that should be a
  • 1:43 - 1:45
    relatively simple wind up being
  • 1:45 - 1:47
    complicated simply because there really
  • 1:47 - 1:51
    are so many options yeah can be a good
  • 1:51 - 1:54
    thing they can be a pain in the butt so
  • 1:54 - 1:55
    what I'm going to be showing you to how
  • 1:55 - 1:57
    to do today on the Ubuntu server is I'm
  • 1:57 - 1:58
    actually I'm going to show you how to
  • 1:58 - 2:01
    find your IP address and your subnet
  • 2:01 - 2:02
    mask I'm going to show you how to be
  • 2:02 - 2:04
    able to find your default gateway I'm
  • 2:04 - 2:06
    going to show you how to find your DNS
  • 2:06 - 2:08
    servers then what I'm going to show you
  • 2:08 - 2:10
    how to do is how to release and renew
  • 2:10 - 2:13
    your DHCP IP address
  • 2:13 - 2:15
    then I'm going to show you how to create
  • 2:15 - 2:17
    a static IP address on your server again
  • 2:17 - 2:19
    this will all be within the Ubuntu 18
  • 2:19 - 2:21
    point oh four point three
  • 2:21 - 2:24
    LTS server so again everything that I
  • 2:24 - 2:27
    show you today you know kinda kind of
  • 2:27 - 2:29
    keep the process in mind
  • 2:29 - 2:32
    yes realize for you to for you to do it
  • 2:32 - 2:34
    you may have to do a little bit of
  • 2:34 - 2:36
    Google search so with that let's go over
  • 2:36 - 2:38
    to the server so I can show you how all
  • 2:38 - 2:41
    this works so here we are at my Ubuntu
  • 2:41 - 2:43
    server again I'm running this on a Mac
  • 2:43 - 2:46
    operating system and using VirtualBox in
  • 2:46 - 2:48
    order to virtualize the instance of
  • 2:48 - 2:50
    ubuntu server for the networking
  • 2:50 - 2:52
    component just realize if we go into
  • 2:52 - 2:54
    settings and we go into network for what
  • 2:54 - 2:56
    I'm showing you today I'm using a
  • 2:56 - 2:58
    bridged adapter and I'm actually using a
  • 2:58 - 3:00
    hardwired connection for the networking
  • 3:00 - 3:04
    interfaces so when this virtual machine
  • 3:04 - 3:05
    goes to communicate with the outside
  • 3:05 - 3:07
    world it will be going through a bridge
  • 3:07 - 3:11
    adapter so if you are using the net on
  • 3:11 - 3:13
    here or in that network or something
  • 3:13 - 3:14
    else some of the settings some of the
  • 3:14 - 3:16
    things that you see may be a little bit
  • 3:16 - 3:18
    different than what I'm showing you
  • 3:18 - 3:20
    should it be significantly different but
  • 3:20 - 3:22
    just something to keep in mind so let's
  • 3:22 - 3:26
    login to my my little server here I'm
  • 3:26 - 3:27
    gonna go on with Bob again and one two
  • 3:27 - 3:31
    three four five six and here we go are
  • 3:31 - 3:33
    we are now logged into the server let me
  • 3:33 - 3:35
    clear the screen and now the first thing
  • 3:35 - 3:37
    that I'm going to show you how to do is
  • 3:37 - 3:39
    find your IP address now back in the old
  • 3:39 - 3:41
    days back in the old days like a couple
  • 3:41 - 3:45
    of days ago I would use ifconfig again
  • 3:45 - 3:46
    this is an important thing to understand
  • 3:46 - 3:48
    in the linux world there's a thousand
  • 3:48 - 3:51
    ways to skin a cat so for a long time we
  • 3:51 - 3:53
    have been using the command ifconfig so
  • 3:53 - 3:55
    if you go back and you're you're
  • 3:55 - 3:56
    researching something again something
  • 3:56 - 3:58
    about networking and they tell you to
  • 3:58 - 4:01
    use ifconfig that was the tool that was
  • 4:01 - 4:03
    used for a really freaking long time
  • 4:03 - 4:05
    right and so if you use the ifconfig
  • 4:05 - 4:08
    tool basically with this this is going
  • 4:08 - 4:10
    to give your your IP address so it's
  • 4:10 - 4:12
    going to tell you what your internet
  • 4:12 - 4:13
    connection is with the name of your
  • 4:13 - 4:17
    network connection is so a np0 s3 so
  • 4:17 - 4:18
    whenever we're chatting modifying
  • 4:18 - 4:20
    configurations for this particular
  • 4:20 - 4:22
    network connection that is what the name
  • 4:22 - 4:24
    is going to be do you remember with a
  • 4:24 - 4:26
    computer you may have a multiple network
  • 4:26 - 4:29
    right you may have three or four ten
  • 4:29 - 4:31
    different network cards in your system
  • 4:31 - 4:33
    so each one of them could be configured
  • 4:33 - 4:35
    differently so whenever you're going in
  • 4:35 - 4:37
    and doing modifications do make sure
  • 4:37 - 4:39
    you're modifying at the right network
  • 4:39 - 4:40
    card so this is the name of the network
  • 4:40 - 4:42
    card if there were more network cards
  • 4:42 - 4:45
    you'd see more names we can see that has
  • 4:45 - 4:47
    the I net so this is the TCP IP address
  • 4:47 - 4:51
    of 10 0.14 and it has a subnet mask of
  • 4:51 - 4:54
    255.255.255.0
  • 4:54 - 4:57
    so again ifconfig to be clear though is
  • 4:57 - 5:00
    the old way of doing it although as all
  • 5:00 - 5:02
    these things do it still works but to be
  • 5:02 - 5:04
    clear they really are trying to get rid
  • 5:04 - 5:07
    of ifconfig instead of ifconfig what
  • 5:07 - 5:09
    they want you to do now is use IP IP
  • 5:09 - 5:12
    tool so simply IP and to find your
  • 5:12 - 5:15
    address you simply do space addr and
  • 5:15 - 5:17
    this will give you the address if we hit
  • 5:17 - 5:19
    enter now if we're taking a look at this
  • 5:19 - 5:21
    we can see we're basically getting the
  • 5:21 - 5:23
    same type of information that we're
  • 5:23 - 5:25
    getting out of ifconfig but it's but
  • 5:25 - 5:27
    it's just in a different format right so
  • 5:27 - 5:28
    what we're gonna do is we're actually
  • 5:28 - 5:31
    going to go to the second entry here
  • 5:31 - 5:33
    again that is going to be our network
  • 5:33 - 5:36
    interface and P is 0 s3 just like we
  • 5:36 - 5:38
    just saw up here with ifconfig and then
  • 5:38 - 5:39
    we can come down we can look at some
  • 5:39 - 5:41
    different information and now for our
  • 5:41 - 5:43
    Internet address here we can see that
  • 5:43 - 5:46
    it's a 10.0 not 1.4 just like it is up
  • 5:46 - 5:49
    here but instead of actually saying what
  • 5:49 - 5:51
    the subnet mask is spelling up out the
  • 5:51 - 5:54
    subnet mask you get the slash 24 so in
  • 5:54 - 5:56
    the networking world you'll see this so
  • 5:56 - 6:00
    a class a network is a slash 8 a Class B
  • 6:00 - 6:02
    Network is a Class A slash 16 and of
  • 6:02 - 6:04
    course a Class C Network would be a
  • 6:04 - 6:07
    slash 24 so depending on how many octet
  • 6:07 - 6:09
    are in your subnet mask you'll do the
  • 6:09 - 6:11
    slash and whatever that is so what I can
  • 6:11 - 6:13
    see here then is I can have an intern I
  • 6:13 - 6:16
    have an internet duress address of 1002
  • 6:16 - 6:21
    1.4 and it's 255.255.255.0 subnet mask
  • 6:21 - 6:23
    so that's again just one of those a
  • 6:23 - 6:25
    little bit of differences and again you
  • 6:25 - 6:27
    know for you doing things your own way
  • 6:27 - 6:29
    I still like I have config at use
  • 6:29 - 6:33
    ifconfig but but to be clear apparently
  • 6:33 - 6:34
    everybody is supposed to be getting
  • 6:34 - 6:37
    pushed into the IP tool for dealing with
  • 6:37 - 6:38
    IP addresses and so you
  • 6:38 - 6:42
    an IP space addr this is what you get
  • 6:42 - 6:44
    you come down here this will tell you
  • 6:44 - 6:46
    what the name of your network adapter is
  • 6:46 - 6:48
    this will tell you what the internet the
  • 6:48 - 6:49
    network address is and then the slash
  • 6:49 - 6:52
    that tells you what the subnet mask is
  • 6:52 - 6:54
    and so that's all there is in order to
  • 6:54 - 6:57
    find what your IP address is we'll let
  • 6:57 - 7:00
    me clear the screen and so now what
  • 7:00 - 7:02
    we're going to do is we're going to take
  • 7:02 - 7:03
    a look at what your default gateway is
  • 7:03 - 7:07
    so again lots of tools lots of tools to
  • 7:07 - 7:08
    find out your default gateway as I just
  • 7:08 - 7:10
    picked this one if you know a different
  • 7:10 - 7:12
    way of doing it do a different way
  • 7:12 - 7:14
    there's a tool called route XI new route
  • 7:14 - 7:18
    space - and basically what this is going
  • 7:18 - 7:20
    to do is it's going to show you how how
  • 7:20 - 7:23
    traffic gets routed from your computer
  • 7:23 - 7:26
    to the outside world and then - in what
  • 7:26 - 7:28
    this does is actually gives you the IP
  • 7:28 - 7:30
    addresses so what I'll show you is if I
  • 7:30 - 7:33
    simply do route without the - end and we
  • 7:33 - 7:35
    go down here what we can see is the
  • 7:35 - 7:37
    destination default and then we just see
  • 7:37 - 7:38
    this gateway right so when it says
  • 7:38 - 7:41
    gateway we just see gateway well that's
  • 7:41 - 7:42
    not really useful so that's like the
  • 7:42 - 7:45
    name of the gateway but I don't really
  • 7:45 - 7:46
    need to know the name of the gateway I
  • 7:46 - 7:47
    need to know the IP address of the
  • 7:47 - 7:50
    Gateway so a new route space - n
  • 7:50 - 7:52
    basically that says turn this into
  • 7:52 - 7:56
    numbers instead of names and then what I
  • 7:56 - 7:58
    can see here is now with this I have the
  • 7:58 - 8:01
    DS destination so default basically
  • 8:01 - 8:03
    anything that is outside of this network
  • 8:03 - 8:05
    and the gateway is going to be ten dot
  • 8:05 - 8:08
    zero dot one dot one so that's what my
  • 8:08 - 8:10
    default gateway is and so this is a way
  • 8:10 - 8:12
    that you can go and just take a look at
  • 8:12 - 8:14
    how the routing is done your particular
  • 8:14 - 8:16
    Linux box and something to think about
  • 8:16 - 8:18
    is if you have a simple Linux box again
  • 8:18 - 8:20
    like this is a simple server you should
  • 8:20 - 8:23
    only have a few settings here again with
  • 8:23 - 8:25
    how this is supposed to work if you're
  • 8:25 - 8:27
    having a networking issues with your
  • 8:27 - 8:28
    Linux server you're going in behind
  • 8:28 - 8:30
    somebody else and for some reason you're
  • 8:30 - 8:32
    getting weird sporadic problems if you
  • 8:32 - 8:34
    come here and you see a lot of other
  • 8:34 - 8:38
    records in this in the surrounding table
  • 8:38 - 8:40
    it might mean that basically you have
  • 8:40 - 8:42
    bad records or you may have problematic
  • 8:42 - 8:44
    records within this table and that
  • 8:44 - 8:46
    you'll probably want to eliminate those
  • 8:46 - 8:47
    might be one of the problems that's
  • 8:47 - 8:49
    going on we're not going to get into
  • 8:49 - 8:51
    that today all we care about today is
  • 8:51 - 8:54
    this first when you look at 0.0.0.0 this
  • 8:54 - 8:56
    is the default what is the gateway ten
  • 8:56 - 8:59
    dot zero dot one dot one yay that works
  • 8:59 - 9:00
    again one of the big problems especially
  • 9:00 - 9:02
    when you're using DHCP in the real world
  • 9:02 - 9:05
    and sometimes when somebody's setting up
  • 9:05 - 9:06
    the DHCP server
  • 9:06 - 9:08
    they simply fat-finger something they
  • 9:08 - 9:11
    plug in the wrong default gateway you
  • 9:11 - 9:13
    know they put a ten dot again like they
  • 9:13 - 9:16
    do like 10.1.1.1 instead of ten dot zero
  • 9:16 - 9:17
    dot one dot one you can't get to the
  • 9:17 - 9:18
    outside world
  • 9:18 - 9:20
    and simply the reason is is because you
  • 9:20 - 9:22
    don't have the right default gateway so
  • 9:22 - 9:24
    this is where you can go in and take a
  • 9:24 - 9:25
    look at that so let me clear the screen
  • 9:25 - 9:28
    again and now we're just going to go in
  • 9:28 - 9:30
    and take a look at the DNS so this is
  • 9:30 - 9:33
    for this is using system D again system
  • 9:33 - 9:36
    D is part of a part of bun team at this
  • 9:36 - 9:39
    point depending on what version of
  • 9:39 - 9:41
    Ubuntu and what distribution you're
  • 9:41 - 9:43
    using it may or may not be in what
  • 9:43 - 9:44
    you're using so this is one of those
  • 9:44 - 9:46
    things that again might be problematic
  • 9:46 - 9:47
    for you you might have to go and do
  • 9:47 - 9:49
    Google search to find out what works on
  • 9:49 - 9:51
    your particular system so what we're
  • 9:51 - 9:52
    going to be doing is we just simply want
  • 9:52 - 9:55
    to see what our DNS servers are so if we
  • 9:55 - 10:00
    do system D - resolve space - - - - not
  • 10:00 - 10:03
    a single - a double - and then we ask
  • 10:03 - 10:04
    what the status is and then we're going
  • 10:04 - 10:07
    to hit enter and so here we have the
  • 10:07 - 10:10
    global settings so for the DNS server
  • 10:10 - 10:11
    10011
  • 10:11 - 10:13
    we can see the DNS domain if we care
  • 10:13 - 10:15
    about that and then if we scroll down
  • 10:15 - 10:17
    one of the things we can see so up here
  • 10:17 - 10:19
    this is like a global setting it's
  • 10:19 - 10:20
    supposed to be the global setting for
  • 10:20 - 10:22
    the entire system kind of like a default
  • 10:22 - 10:23
    for any network cards you would install
  • 10:23 - 10:25
    but then we can go down and take a look
  • 10:25 - 10:27
    at the specific network cards so again e
  • 10:27 - 10:30
    and p0 s3 and that's the name of the
  • 10:30 - 10:32
    interface that we're using current
  • 10:32 - 10:34
    scopes blah blah blah then we can come
  • 10:34 - 10:36
    down here to DNS servers and we can see
  • 10:36 - 10:40
    is 10.0 dot 1.1 see the DNS domain is
  • 10:40 - 10:43
    Verizon dotnet so I know that's how it's
  • 10:43 - 10:44
    supposed to be and so that's that's a
  • 10:44 - 10:46
    way I can go in and check to see what
  • 10:46 - 10:49
    the DNS servers are to make sure why or
  • 10:49 - 10:52
    why not the DNS is resolving properly
  • 10:52 - 10:55
    and so that's the basic way to see what
  • 10:55 - 10:57
    your IP address is to see what your
  • 10:57 - 11:00
    default gateway is and how to see your
  • 11:00 - 11:02
    your DNS so to get out of here all you
  • 11:02 - 11:05
    do is you press Q and now you're out of
  • 11:05 - 11:06
    here
  • 11:06 - 11:09
    so let's now talk about DHCP so I'm
  • 11:09 - 11:12
    going to clear the screen and so at this
  • 11:12 - 11:14
    point we need to actually be able to
  • 11:14 - 11:16
    release our DHCP address and renew our
  • 11:16 - 11:19
    DHCP address again you get a lot of
  • 11:19 - 11:20
    weird networking problems where
  • 11:20 - 11:24
    sometimes with leases leases expire but
  • 11:24 - 11:25
    you know things haven't synchronized
  • 11:25 - 11:26
    properly so you mean it may need to
  • 11:26 - 11:29
    renew your DHCP address so with this you
  • 11:29 - 11:31
    simply use super Susu do so Super User
  • 11:31 - 11:34
    do and then you use a tool called D bake
  • 11:34 - 11:40
    client client defined spell space and
  • 11:40 - 11:42
    now one of the things I'm going to add
  • 11:42 - 11:44
    is something called - V so what - V is
  • 11:44 - 11:47
    you do not have to add - V - V is
  • 11:47 - 11:49
    verbose so you'll see this and some of
  • 11:49 - 11:51
    the tools that I'm showing you or maybe
  • 11:51 - 11:54
    sometimes you simply put verbose N or -
  • 11:54 - 11:56
    V and what this does is the computer
  • 11:56 - 11:58
    then kind of tells you what's going on
  • 11:58 - 11:59
    while it's going through a process and
  • 11:59 - 12:02
    then the important one that you do have
  • 12:02 - 12:04
    to do is - R so what this is does is it
  • 12:04 - 12:07
    releases it forces the release of the
  • 12:07 - 12:10
    DHCP address so if we get enter ask for
  • 12:10 - 12:13
    the password one two three four five six
  • 12:13 - 12:16
    killing old process dah dah dah
  • 12:16 - 12:18
    and so now it's done the IP address has
  • 12:18 - 12:22
    been released if we do IP space addr to
  • 12:22 - 12:24
    see what our IP address is and we hit
  • 12:24 - 12:27
    enter we can see we come down here again
  • 12:27 - 12:31
    to e + p0 s 3 that is our interface card
  • 12:31 - 12:33
    and we can see that it does not have an
  • 12:33 - 12:36
    IP for address it's only clear the
  • 12:36 - 12:38
    screen then pass this all you have to do
  • 12:38 - 12:42
    in order to actually obtain a DHCP
  • 12:42 - 12:44
    address as you simply use superuser do
  • 12:44 - 12:48
    again D H client and then I'll do the
  • 12:48 - 12:51
    space - V so you don't need the space I
  • 12:51 - 12:53
    have in V this is simply for verbose so
  • 12:53 - 12:55
    it tells us what's going on and then I
  • 12:55 - 12:58
    hit enter and we can see here you know
  • 12:58 - 13:00
    it goes through and then it picks up the
  • 13:00 - 13:03
    IP address for us if we do IP addr at
  • 13:03 - 13:05
    this point we can come and we can now
  • 13:05 - 13:08
    see we have the IP address of 10 0
  • 13:08 - 13:11
    1:14 with a slash 24 so that's a Class C
  • 13:11 - 13:16
    of 255.255.255.0 subnet mask and that's
  • 13:16 - 13:19
    really all there is to releasing and
  • 13:19 - 13:22
    renewing your your DHCP address from
  • 13:22 - 13:25
    that now we need to go in to actually
  • 13:25 - 13:28
    modify the static IP address so let me
  • 13:28 - 13:31
    clear the screen again and now we're
  • 13:31 - 13:33
    going to go in and we are going to edit
  • 13:33 - 13:37
    a particular file so the first thing
  • 13:37 - 13:38
    that we need to do is we need to change
  • 13:38 - 13:40
    directory and then we're going to go to
  • 13:40 - 13:45
    /et see slash net plan so net plan is
  • 13:45 - 13:48
    the tool that's currently used to kind
  • 13:48 - 13:49
    of like manage the IP addresses and all
  • 13:49 - 13:52
    that kind of stuff on the Ubuntu server
  • 13:52 - 13:54
    so we're going to go into the directory
  • 13:54 - 13:55
    and then what we're going to be looking
  • 13:55 - 13:57
    for is the configuration file for
  • 13:57 - 14:01
    netplan and it's a dot llamo file dot
  • 14:01 - 14:03
    why am L that is the networking
  • 14:03 - 14:07
    configuration file so we do an LS - L -
  • 14:07 - 14:09
    a list everything in the net plan
  • 14:09 - 14:12
    directory and we see this 50 - cloud -
  • 14:12 - 14:17
    ini te amo file so this is the file that
  • 14:17 - 14:18
    we are going to edit in order to give
  • 14:18 - 14:21
    ourselves a static IP address so what
  • 14:21 - 14:23
    we're going to do a superuser do we are
  • 14:23 - 14:26
    going to use vim again it was whatever
  • 14:26 - 14:28
    the hell text editor you want to use I
  • 14:28 - 14:31
    like vim I use vim so I'm showing you
  • 14:31 - 14:33
    with them and then you're gonna do 50 -
  • 14:33 - 14:40
    the cloud - I and I T dot why am L that
  • 14:40 - 14:43
    sure that's all right and then hit enter
  • 14:43 - 14:46
    and now we are in that dot EML file and
  • 14:46 - 14:48
    so from here we're going to do some
  • 14:48 - 14:50
    editing so if we look right at this
  • 14:50 - 14:51
    point in time there's not a whole hell
  • 14:51 - 14:53
    of a lot in this yamo file and the main
  • 14:53 - 14:55
    reason is because of this setting right
  • 14:55 - 14:59
    here DHCP for : yes so basically what
  • 14:59 - 15:02
    that means is hey go grab the all of the
  • 15:02 - 15:04
    information from the DHCP server and so
  • 15:04 - 15:05
    we don't need to write anything else
  • 15:05 - 15:07
    right well when you're going to actually
  • 15:07 - 15:09
    go in to here and we are going to put
  • 15:09 - 15:12
    everything in for me static so instead
  • 15:12 - 15:15
    of having yes so I hit I is for insert
  • 15:15 - 15:18
    then I'm going to delete yes and I'm
  • 15:18 - 15:20
    gonna say no
  • 15:20 - 15:21
    again there's no semicolons or commas or
  • 15:21 - 15:23
    anything after that you just simply put
  • 15:23 - 15:26
    no and then you go to the next line from
  • 15:26 - 15:29
    there we're going to type in addresses
  • 15:29 - 15:32
    and so it's addresses and then it's
  • 15:32 - 15:35
    colon and then you hit enter and then
  • 15:35 - 15:39
    you - space and then whatever address
  • 15:39 - 15:41
    you want this system to have so we're
  • 15:41 - 15:45
    just gonna do 192.168.1 I don't know 10
  • 15:45 - 15:47
    basically I'm just giving this a crap IP
  • 15:47 - 15:50
    address just so when we do the the IP
  • 15:50 - 15:52
    address command you can see that it's
  • 15:52 - 15:55
    truly different and I haven't done
  • 15:55 - 15:56
    anything else that's weird
  • 15:56 - 15:58
    past that I didn't need to do this the
  • 15:58 - 16:00
    forward slash and then I need to give
  • 16:00 - 16:02
    what this subnet mask is so this is one
  • 16:02 - 16:04
    of those things that can confuse people
  • 16:04 - 16:06
    if you just put an IP address it will
  • 16:06 - 16:08
    fail so you need to put the forward the
  • 16:08 - 16:10
    forward slash and then what the subnet
  • 16:10 - 16:16
    mask is so for 192.168.1.0 subnet if
  • 16:16 - 16:20
    that's a slash 24 255.255.255.0 class
  • 16:20 - 16:24
    see that's a slash 24 sm okay and so
  • 16:24 - 16:25
    past that then we're gonna go down hit
  • 16:25 - 16:28
    enter and then we're gonna do gateway
  • 16:28 - 16:31
    for an already do :
  • 16:31 - 16:32
    and see as soon as I do : it
  • 16:32 - 16:34
    automatically did that for me it's nice
  • 16:34 - 16:36
    it does a little bit of its own self
  • 16:36 - 16:39
    editing in here self proofreading then
  • 16:39 - 16:40
    I'm gonna do space and I'll do it let's
  • 16:40 - 16:46
    say 192.168.1.1 let's say so again if
  • 16:46 - 16:48
    this was a normal network it would look
  • 16:48 - 16:50
    like that then I'm going to hit enter
  • 16:50 - 16:54
    then I'm going to do name servers then
  • 16:54 - 16:57
    I'm going to do : then I'm going to do
  • 16:57 - 17:00
    enter then addresses so what are the
  • 17:00 - 17:02
    addresses for the name servers colon
  • 17:02 - 17:05
    space little bracket then we could do
  • 17:05 - 17:11
    8.8.8.8 8 and then comma so for a second
  • 17:11 - 17:15
    DNS server then I can do one that 1.1.1
  • 17:15 - 17:18
    let's say and close the bracket and so
  • 17:18 - 17:20
    that's basically all that has to be done
  • 17:20 - 17:23
    here so we do go to DHCP for we say no
  • 17:23 - 17:26
    we type in addresses : go to the next
  • 17:26 - 17:29
    line - you know space whatever the
  • 17:29 - 17:31
    address is slash whatever
  • 17:31 - 17:34
    subnet mask is we say gateway for we
  • 17:34 - 17:36
    plug in the gateway for IP address we
  • 17:36 - 17:38
    say name servers : and we do the
  • 17:38 - 17:40
    addresses in the name servers and that's
  • 17:40 - 17:41
    really all there is to it so from here
  • 17:41 - 17:43
    what I'm going to do is I'm going to hit
  • 17:43 - 17:47
    escape then I'm going to hit : WQ so
  • 17:47 - 17:48
    again depending on what editor you're
  • 17:48 - 17:52
    using what WQ does is it save and quit
  • 17:52 - 17:55
    so it saves what I've done and quits so
  • 17:55 - 17:56
    if you're using a different editor just
  • 17:56 - 17:59
    do that and whatever you're using and
  • 17:59 - 18:01
    then I'm going to hit enter so we can
  • 18:01 - 18:03
    come down here we can see the amel it
  • 18:03 - 18:06
    was written if you have any errors in
  • 18:06 - 18:08
    this you will get errors so just keep
  • 18:08 - 18:09
    that in mind like I want to show you
  • 18:09 - 18:11
    something here alright so we go back
  • 18:11 - 18:15
    coups and we go to edit so let's say I'm
  • 18:15 - 18:18
    editing this when I do something like
  • 18:18 - 18:21
    instead of addresses I just do address
  • 18:21 - 18:23
    write again a fat finger something so I
  • 18:23 - 18:27
    escape : WQ write quit and so we see
  • 18:27 - 18:30
    that we have the 50 - cloud - ini T dot
  • 18:30 - 18:33
    yeah mol file and it has been written
  • 18:33 - 18:36
    now passed this do remember in the Linux
  • 18:36 - 18:39
    world you actually have to apply changes
  • 18:39 - 18:42
    so if you're changing a configuration
  • 18:42 - 18:44
    file for an Apache server or a squid
  • 18:44 - 18:45
    server or something like that you have
  • 18:45 - 18:48
    to restart the service kind of sort of
  • 18:48 - 18:49
    the same thing with netplan what you
  • 18:49 - 18:51
    have to do is you have to type in sudo
  • 18:51 - 18:54
    you have to type in net plan space and
  • 18:54 - 18:57
    then you have to say apply so until you
  • 18:57 - 19:00
    do this apply it's still running off of
  • 19:00 - 19:02
    the old rules then I'm going to hit
  • 19:02 - 19:05
    enter you don't see any errors here so
  • 19:05 - 19:07
    if there are any problems in this file
  • 19:07 - 19:09
    there will be errors when I did the
  • 19:09 - 19:11
    apply you see if there's no errors so
  • 19:11 - 19:13
    everything went through okay let me do
  • 19:13 - 19:15
    clear and then from here I can do IP
  • 19:15 - 19:20
    space ADB are hit enter and what I can
  • 19:20 - 19:22
    see when I come down here to en p0 s3
  • 19:22 - 19:26
    here's the inode address 192.168.1.1
  • 19:26 - 19:30
    slash 24 so that's showing me what the
  • 19:30 - 19:33
    IP address is so that's how you're able
  • 19:33 - 19:36
    to add a static IP address and actually
  • 19:36 - 19:39
    make this system use it so that's really
  • 19:39 - 19:42
    what there is to doing basic and network
  • 19:42 - 19:45
    configurations on a Linux box then
  • 19:45 - 19:47
    anything to realize though is you may be
  • 19:47 - 19:49
    may you may have to use different tools
  • 19:49 - 19:52
    with your particular system so just keep
  • 19:52 - 19:55
    in mind what I showed you and then
  • 19:55 - 19:57
    realize you might have to use those same
  • 19:57 - 19:59
    steps literally just simply with a
  • 19:59 - 20:00
    different tool it's kind of like with
  • 20:00 - 20:03
    ifconfig ifconfig still works but they
  • 20:03 - 20:06
    want everybody to start using IP so on
  • 20:06 - 20:08
    your particular box you may just have to
  • 20:08 - 20:10
    use it as a different command in order
  • 20:10 - 20:12
    to get to the same place so those are
  • 20:12 - 20:14
    the basic steps for configuring a Linux
  • 20:14 - 20:18
    networking on Ubuntu server again do
  • 20:18 - 20:19
    realize with your particular server
  • 20:19 - 20:21
    depending on the version the
  • 20:21 - 20:23
    distribution whatever the hell the
  • 20:23 - 20:25
    previous administrator installed on it
  • 20:25 - 20:27
    you may have to go through more or less
  • 20:27 - 20:30
    the exact same steps but you know
  • 20:30 - 20:32
    actually use a different piece of
  • 20:32 - 20:34
    software or a different set of commands
  • 20:34 - 20:36
    so just kind of keep that in mind
  • 20:36 - 20:38
    realize you may have to do a little bit
  • 20:38 - 20:39
    of googling in order to get to the same
  • 20:39 - 20:42
    place this is one of those areas I have
  • 20:42 - 20:44
    to say you know if you don't mind using
  • 20:44 - 20:47
    a graphical user interface if it was not
  • 20:47 - 20:50
    bad to use a GUI on your Linux server I
  • 20:50 - 20:52
    do have to say using the GUI tools in
  • 20:52 - 20:54
    order to administer your networking
  • 20:54 - 20:57
    configurations is a hell of a lot easier
  • 20:57 - 20:59
    and a hell of a lot simpler to do but
  • 20:59 - 21:01
    again if you're using the one except the
  • 21:01 - 21:04
    command line these are the basic the
  • 21:04 - 21:05
    basic steps that you have to go through
  • 21:05 - 21:06
    so again in order to find what your IP
  • 21:06 - 21:10
    address is use a tool called IP in order
  • 21:10 - 21:12
    to be able to release and renew your
  • 21:12 - 21:15
    your DHCP address you used eh client you
  • 21:15 - 21:17
    can use route space - in to see what
  • 21:17 - 21:20
    your gateway is but again there's also a
  • 21:20 - 21:22
    lot of other tools out there I'm sure
  • 21:22 - 21:23
    other people will say there's a better
  • 21:23 - 21:25
    way of doing it you can use that system
  • 21:25 - 21:28
    the status command in order to see what
  • 21:28 - 21:30
    your DNS servers is and then you can go
  • 21:30 - 21:32
    in you can change that dot ya know file
  • 21:32 - 21:34
    and your net plank configuration it's in
  • 21:34 - 21:36
    order to give yourself a static IP
  • 21:36 - 21:39
    address so this just gives you kind of
  • 21:39 - 21:42
    that basic idea of what's going on again
  • 21:42 - 21:43
    depending on what system that you're
  • 21:43 - 21:46
    using you may use different tools and to
  • 21:46 - 21:48
    be clear as with all of these things in
  • 21:48 - 21:50
    the Linux world you can get using it
  • 21:50 - 21:51
    into the weeds quick if you want to
  • 21:51 - 21:53
    start doing some really fancy
  • 21:53 - 21:55
    complicated networking configurations
  • 21:55 - 21:57
    you can do a whole bunch of stuff on a
  • 21:57 - 21:58
    Linux server
  • 21:58 - 22:00
    in general these are the tools that
  • 22:00 - 22:02
    you're gonna use one of the nice things
  • 22:02 - 22:03
    I do have to say about the Lenox world
  • 22:03 - 22:04
    one of the good things about Milan
  • 22:04 - 22:06
    ex-world is because it is generally so
  • 22:06 - 22:08
    stable and again it really does do
  • 22:08 - 22:10
    whatever the hell you tell it to do the
  • 22:10 - 22:11
    nice thing with the networking
  • 22:11 - 22:13
    configurations is this is one of those
  • 22:13 - 22:15
    things you set once and basically forget
  • 22:15 - 22:16
    for the rest of the time that your
  • 22:16 - 22:19
    system is up and running so once you get
  • 22:19 - 22:21
    everything working properly the good
  • 22:21 - 22:22
    part is you probably won't have to come
  • 22:22 - 22:24
    back and mess with this a whole bunch
  • 22:24 - 22:26
    but you know realistically you may have
  • 22:26 - 22:28
    to go in and deal with things you may
  • 22:28 - 22:30
    also have to use different tools so I
  • 22:30 - 22:33
    remember when I had my I had my servers
  • 22:33 - 22:35
    in a colocation facility that when I
  • 22:35 - 22:37
    started doing videos and I actually had
  • 22:37 - 22:39
    my own servers in order to do the videos
  • 22:39 - 22:41
    I actually had to download an additional
  • 22:41 - 22:44
    tool to act to be able to set the speed
  • 22:44 - 22:46
    of the network car so my network card o
  • 22:46 - 22:50
    was a 10 100 gig network card and so in
  • 22:50 - 22:51
    order for it to work properly with the
  • 22:51 - 22:53
    data center instead of having an auto
  • 22:53 - 22:57
    configure itself for the speed I was
  • 22:57 - 22:59
    required to statically assign whatever
  • 22:59 - 23:01
    speed that network card was and so that
  • 23:01 - 23:02
    was something where I actually had to
  • 23:02 - 23:05
    download or and install a separate piece
  • 23:05 - 23:06
    of software and use that to do the
  • 23:06 - 23:08
    configuration for the network heart
  • 23:08 - 23:10
    speed and so those are the kinds of
  • 23:10 - 23:11
    things you have to be thinking about
  • 23:11 - 23:12
    when you start dealing with networking
  • 23:12 - 23:15
    this isn't it this is a one nice package
  • 23:15 - 23:16
    with a whole bunch of options and
  • 23:16 - 23:19
    arguments and commands it's you know d-h
  • 23:19 - 23:23
    client and system B and route this again
  • 23:23 - 23:25
    you duct tape all that together you get
  • 23:25 - 23:27
    a server that somehow is able to
  • 23:27 - 23:28
    communicate with the outside world
  • 23:28 - 23:32
    so with that as always I enjoy doing
  • 23:32 - 23:33
    this video and I look forward to seeing
  • 23:33 - 23:36
    it at the next one
Title:
Linux - Network Configuration (ip, route, dhclient, systemd-resolve, netplan)
Description:

more » « less
Video Language:
English
Duration:
23:35

English subtitles

Revisions Compare revisions