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