How to configure networking in linux for beginners – I


How to configure networking in Linux



As a Linux server administrator, you need to manage network addresses and network interfaces. The  network addresses can be assigned in two ways:

Fixed IP addresses : Useful for servers that always need to be available at the same IP address.

Dynamically assigned IP addresses : Useful for end-users devices, and for instances in a cloud environment. To dynamically assign IP addresses, a Dynamic Host Configuration Protocol (DHCP) server is usually used.

For a long time, network cards in Linux have had default names, such as eth0, eth1, and eth2. This naming was assigned based on the order of detection of the network card. So, eth0 was the first network card that got detected, eth1 the second, and so on. This worked well in an environment where a node has one or two network cards only. If a node has multiple network cards that need to be dynamically added and removed, however, this approach does not work so well anymore.

 Apart from this default device naming, network cards can be named based on the BIOS device name as well. In this naming, names such as em1 (embedded network card 1) or p4p1 (which is PCI slot 4, port 1) can be used. To use this kind of naming, the biosdevname package must be installed

Validating Network Configuration

Before you can learn how to set network information, you must know how to verify current network information.

 To verify the configuration of the network address, you need to use the ip utility. The ip utility is a modern utility that can consider advanced networking features that have been introduced recently. With the ip utility, many aspects of networking can be monitored:

■ Use ip addr to configure and monitor network addresses
■ Use ip route to configure and monitor routing information
■ Use ip link to configure and monitor network link state

 In earlier Linux versions, and some other UNIX-like operating systems,the ifconfig utility was and is used for validating network configuration.

 Monitoring Current Network Configuration with ip addr show



Monitoring Current Routing information with ip route show



Monitoring Current Network Link Information with ip link show


If your computer is connected to the Internet, you can now use the ping command to verify the connection to the Internet is working properly. Type ping -c 4 , for instance, to send four packets to IP address If your Internet connection is up and running, you should get “echo reply” answers.

 Type ss -tul . You’ll now see a list of all UDP and TCP ports that are listening on your server.



 You would like to set with static IP address. Next, locate a corresponding script to the network interface name. In our case this is enp3s0 located at /etc/sysconfig/network-scripts/ Open the  file corresponding to your network interface and enter the following information. Note that your HWADDR,DEVICE,UUID will be different:

 Read also:

How to configure squid proxy server for Beginers

FTP(File Transfer Protocol) in LINUX


for more articals visit: