5.1 Using Network Configuration Tools: Unit V:Networking and TCP/IP
5.1 Using Network Configuration Tools: Unit V:Networking and TCP/IP
5.1 Using Network Configuration Tools: Unit V:Networking and TCP/IP
To configure the hardware through a graphical interface we can use the Red Hat’s
graphical tool called redhat-config-network / system- config-network or the
console-based netconfig (netcfg) command.
BSC[CS] TY, LINUX ADMINISTRATION
• We can configure a network interface from the command line using the basic
Linux networking utilities. We can configure the network client hosts with the
command line by using commands to change the current settings or by editing a
number of system files. Two commands, ifconfig & route, are used for network
configuration. The netstat command displays information about the network
connections.
/sbin/ifconfig command
-to-point connection.
# /sbin/ifconfig
The output is easily understood, the above command will display the current status
of the system regarding the network, for example the IP address, subnet mask etc.
The ifconfig command can be used to display information about or control a specific
interface. For example to deactivate the first Ethernet device on a host, use the
ifconfig command like this -
Linux ifconfig
The command ifconfig stands for interface configurator. This command enables us
to initialize an interface, assign IP address, enable or disable an interface. It display
route and network interface.
You can view IP address, MAC address and MTU (Maximum Transmission Unit)
with ifconfig command.
A newer version of ifconfig is ip command. ifconfig command works for all the
versions.
Syntax:
# ifconfig
BSC[CS] TY, LINUX ADMINISTRATION
1. ifconfig eth0
2. ifconfig lo
3. ifconfig wlan0
/sbin/route command
• The second command used to configure the network is the route command.
route is used to build the routing tables(in memory) implemented for routing
packets as well as displaying the routing information. It is used after ifconfig has
initialized the interface. route is normally used to set up static routes to other
networks via the gateway or to other hosts. The command configuration is like
this:
/sbin/route [options] [commands] [parameters]
• To display the routing table, use the route command with no options. The
display will look similar to this:
# /sbin/route
The route command displays and manipulate IP routing table for your system.
A router is a device which is basically used to determine the best way to
routepackets to a destination.
Syntax:
1. route
BSC[CS] TY, LINUX ADMINISTRATION
The Gateway column lists the gateway that the packets must go through to
reach their destination.
An asterisk (*) means that packets go directly to the host. Genmask is the
netmask.
The Flags column can have several possible entries. In this example, U
verifies that the route is enabled & G specifies that Destination requires the
use of a gateway.
The Metric column displays the distance to the Destination. Some daemons
use this to figure the easiest route to the Destination.
The Ref column is used by some UNIX flavors to convey the references to the
route. It is not used by LINUX.
The Use column indicates the number of times this entry has been looked up.
Finally, the Iface column is the name of the interface for the corresponding
entry.
Using the –n option to the route command will give the same information
Displaying numerical IP address
Syntax:
# route -n
BSC[CS] TY, LINUX ADMINISTRATION
Ping command keeps executing and sends the packet until you interrupt.
Syntax:
The ping command supports various command-line options. But, the basic syntax
for the ping command is as follows:
netstat
netstat(Network Statistics) is the command that is used to display routing table,
connection information, the status of ports, etc. This command works with
Linux Network Subsystem. This command basically displays the content of
/proc/net file defined in the Linux file system.
BSC[CS] TY, LINUX ADMINISTRATION
adaptive resource management, QoS, and solutions for achieving energy efficient
wireless networks Discusses security issues, an essential element of working
with wireless networks Supports the advanced university and training courses in
the field and includes an extensive list of references
# iwlist
# iwconfig
What is the iwconfig command in Linux?
iwconfig is used to display and change the parameters of the network
interface which are specific to the wireless operation (e.g. interface name,
frequency, SSID). It may also be used to display the wireless statistics.
(extracted from /proc/net/wireless ).
The command iwconfig configures a wireless network interface. You can view
and set basic wi-fi details like SSID and encryption. Please refer man page of
iwconfig for more details.
BSC[CS] TY, LINUX ADMINISTRATION
# dhcpd –f
• Along with other information, an error message will be displayed as shown
below can’t open /etc/dhcpd.conf: No such file or directory existing
BSC[CS] TY, LINUX ADMINISTRATION
• Notice the error stating it can’t find /etc/dhcpd.conf. After getting this error the
next step is to create the file. The following is a simple example of dhcpd.conf
for aserver
at 192.168.100.1
Telnet is a remote Login Program. You can Divide Telnet in to Two parts: Telnet-
Server and Telnet-Client. Telnet server is the Machine which allows users to login
to it through remote and the machines which are logged in remotely through telnet
on Telnet Server is known as Telnet Client
Linux telnet Command
In Linux, the telnet command is used to create a remote connection with a system
over a TCP/IP network. It allows us to administrate other systems by the terminal.
We can run a program to conduct administration.
It uses a TELNET protocol. However, this protocol has some security defects, but it
is one of the most used networking protocols due to its simplicity.
The above command will prompt for the user password. Type the password and
press ENTER key; it will start a daemon process and take a while to update your
system.
The above command will install the required package for the telnet protocol.
Consider the below output:
To verify the installation and whether the service is running or not, execute the below
command:
For example, we are connecting our system with the localhost. Execute the
command as follows:
# telnet localhost
BSC[CS] TY, LINUX ADMINISTRATION
The above command will ask for the user name and password, enter the
credential to proceed. Consider the below output:
After connecting, we can execute the commands as done before. The only difference
is that now the machine is treated as a remote machine.
To exit the telnet command, execute the logout command.
# logout
consider the below output:
There are lots of SSH clients that are available for both commercial and free. The
OpenSSH is its most widely used client. It is available for all the most used
platforms such as Windows, Linux, macOS, OpenBSD, and more.
Syntax:
ssh user_name@host(IP/Domain_name)
The server (Host) contains an SSH process that is ready to take a request for the
client connection through a TCP/IP port. Once the client initiates a connection,
the host responds with the necessary information and exchanges the credentials.
The default SSH protocol version for SSH server and SSH client communication
is version 2.
The OpenSSH client is a connectivity tool for the systems to connect two
systems with the ssh protocol. It is also called as ssh and can be invoked from the
Linux terminal. This client package contains other SSH utilities like sftp, scp,
and ssh that are installed by default with the ssh command. It performs remote
operations using these ssh utilities.
The OpenSSH client comes preinstalled with most Linux distributions. If any
Linux system does not have the ssh client, we can install it manually by using the
package manager.
The above sudo command will update the package of the Linux system. Consider
the below snap of the output:
After updating the Linux system, execute the below command to install the
OpenSSH client:
The above command will install the latest package of the OpenSSH client.
Consider the below output:
BSC[CS] TY, LINUX ADMINISTRATION
As we can see from the above output, a daemon process is running to install the
OpenSSH client. As in our machine, OpenSSH client is already installed, so it
has displayed the message 'openssh-client is already the newest version.
To check the installation status of the server, open the terminal and execute the
below command:
$ ssh localhost
If our machine does not have the server tool kit of the OpenSSH client, then it
will display the output as follows:
The above command will prompt for the system administrative password, type
the password, and press ENTER key to start the installation process. Next, it will
confirm the installation type 'y' key and press ENTER key. Consider the below
output:
BSC[CS] TY, LINUX ADMINISTRATION
After confirming the installation, a daemon process will begin and install the
OpenSSH server on your machine.