In this lesson, I'll talk about Linux and networking.
Networking within Linux is a little different than
your traditional networking within OS X or Windows.
Traditionally with Linux servers,
we don't have a GUI,
so we need to operate everything from a command line interface.
That makes troubleshooting a little bit more difficult.
When we're a Linux system administrator,
we may be asked to statically set
information on the network so that we can get to our server all the time.
While, DHCP provides us an IP address right away every time,
it may provide us a different IP address every time.
So, we need to configure the IP address from the command line to
ensure that we get the same IP address every time we try to access that server.
Let's look at both the GUI side and the command line interface.
Different distributions handle networking different ways.
Some call things certain ways and some display information other ways.
So, in order to find the GUI configuration for networking,
you'll have to search for it, in this case,
it was under Settings and then Network.
This is the NetworkManager which is traditionally the piece of software that is
used in GUI to manage your interface connections.
In order to modify these,
I'm gonna click the wheel,
go down to IPv4.
Notice that it's set to Automatic (DHCP).
You may want to change the DNS address.
Here is where I'm going to change the static information for my server.
So I would type in the address,
the netmask, and the gateway.
Now, for the command line interface.
In order to see what the interface is called,
I need to look at what we have in the system.
So I'm gonna type in ifconfig,
and you'll notice eno with a number after it.
This stands for ethernet onboard and then the arbitrary number after it.
Additionally, we have our loopback address,
and we may have other different addresses in here,
for virtualization, for example.
If I were to modify this interface,
going to type in sudo ifconfig and
then the IP address.
I need to have the IP address that I want to
enter plus my net mask – those two need to be known.
I also need to enter in the actual interface that I want to configure.
Once I hit the enter button,
it's going to change the system.
The other thing that I need to do – I'm not gonna actually modify that.
The other thing I need to do is change the route.
The route allows us to have a way to get to the next hop.
I can change the route by typing route add and then the information that I want to,
the router information that add and the destination.
So if I want to change certain routes for certain interfaces,
I can do that by just typing in route add and then the information.
So if I wanted to add 192.168.122.1 for eno16777736,
it's going to change the route for that interface.
However, I don't want to do that because it's working just fine right at the moment.
In order to see if things are working correctly,
we're going to ping resources.
So I'll type in ping and then a name.
I should receive a response back which means
that both my route is working and my DNS is working.
If my DNS is not working,
I can try just pinging the gateway and see if I get a response.
If I don't get a response from the gateway,
then I know there is something wrong with my system.
Let's look at how we configure the network interface if we needed to be persistent.
The way I just showed you will reset once I restart the server,
so I need to have that information saved.
This is located in /etc/sysconfig/network-scripts/
and the interface that I need to configure,
so ifcfg-eno and then the number after it.
Here's the information on that interface.
If I needed to set a static address,
I'm gonna change the boot protocol from DHCP to static.
I'm also going to need to add the IP address information and netmask.
This is very easy,
where I would just type in
IPADDR=192.168.0 – let's say – .2,
and my netmask is 255.255.255.0.
However, since I don't want to modify this at this point,
I'm gonna quit out.
Now let's say that we want to protect certain resources.
Within Linux, it's very easy to create another interface,
especially virtual, and isolate certain resources.
I can do this with firewalls and my interfaces and by modifying the routes.
You may see this in a more secure environment.
In conclusion, troubleshooting with Linux is not difficult.
However, you may have to learn
additional commands in order to get familiar with the interface.