Skip to main content

Networking in Linux

 Networking in Linux : 

ifconfig : lists the ip address and network interface like eth0/eth1/enpos3/lo .

ip addr : lists the interface and ip address .

ip r l : lists ip address .

hostname -I : lists the IP address .

netstat -rnv :  gives the gateway information .

ping www.google.com : ping the ip address of the google .

nslookup www.google.com : it will give the ip address of the google.com and also it will give ip address of our dns server .

Note : if you have the personal linux computer , your dns server and gateway would be same .

systemctl status NetworkManager : shows the status of network manager .

ps -ef | grep NetworkManager : shows the process which is running the network manager .

 

........................................

Network configuration methods : 


1. nmcli : stands for network manager command line interface .This tool is useful when access to graphical environment is not available to make the network configuration changes .


2 .nmtui : stands for network manager text user interface . this tool can be run in any terminal window.

and allows the changes to be made . 


3 . nm-connection-editor : Full graphical management tool providing the access to most of the network management configuration options .it can only be accessed through the desktop or webconsole .


4. GNOME Setings :     it allows the basic network management tasks to be performed .


nmcli : gives the information about the adaptors .

nmcli connection show : gives the list of the network interfaces .

nmcli --help : it shows the options that can be used with nmcli . 

nmcli connection --help : it shows the options that can be used with nmcli connection .

 

Question : How to assign the static ip address to the linux machine using the nmcli ?

Answer : fire the below commands : 


nmcli device 

nmcli connection modify enpos3 ipv4.addresses 10.253.1.34/24 

nmcli connection modify enpos3 ipv4.gateway 10.253.1.1 

nmcli connection modify enpos3 ipv4.method manual 

nmcli connection modify enpos3 ipv4.dns 8.8.8.8 

nmli connection down enpos3 

nmcli connection up enpos3 

ip address show enpos3 

nmcli connection show 



Question : How to add the secondary static ip to the server using nmcli ?

Answer :  Fire the below commands : 


nmcli  device status 

nmcli connection show -active 

ifconfig

nmcli connection modify enpos3  +ipv4.addresses 10.0.0.211/24 

nmcli connection reload 

systemctl reboot 

ip address show 


.........................

Network Files and basic commands as a linux admin we should know : 

files : 

/etc/sysconfig/network-scripts/ifcfg-enpos3 

/etc/hosts 

/etc/hostname  : contains the hostname of the linux machine . we can change it .

/etc/resolv.conf  : gives the information and ip of the dns server . 

/etc/nsswitch.conf 


Commands : 

ping  : pings the ipaddress and output shows if it is pingable or not .

ifconfig  : shows the network interface 

ip r l  : gives the ip address 

hostname -I : gives only the ip address .

ifup or ifdown  : ifup is to activate the network interface and ifdown is for deactivating the network interface .

netstat : it shows the statistics of the network .

traceroute : its a tool for understanding the internet connection problems .

tcpdump : tracing everything that is coming inside of your computer and going outside of your computer. 

nslookup  : it is used to check the dns entry associated with the ip address. 

ethtool  enpos3 : gives the information about your interface .

Comments

Popular posts from this blog

patching tasks

 Patching a Linux system is a critical task to ensure that the system remains secure, stable, and up-to-date with the latest features and fixes. Here’s a comprehensive guide to the tasks involved in Linux patching: 1. Pre-Patching Preparation Backup System : Ensure you have a full system backup, including critical data, configuration files, and applications. Test the backup to verify its integrity. Check Disk Space : Verify that you have enough disk space, particularly on /var , /tmp , and /boot partitions. Review Current Patch Level : Determine the current patch level and installed packages using package management tools like yum , apt , dpkg , or rpm . Check System Logs : Review system logs to identify any issues that might affect the patching process. Test in a Staging Environment : If possible, apply patches in a staging environment that mirrors production to identify potential issues. Notify Stakeholders : Inform stakeholders about the scheduled maintenance window and expecte...

Associate cloud Engineer notes

 google cloud offers below services:  compute  storage big data  machine learning  application services at the end of this notes you will be able to :  identify the value of the google cloud products  use application deployment environment on google cloud use google storage options  interact with google cloud service describe the ways in which customers use google cloud .   >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>. TOPICS:  cloud computing  IAAS ,PAAS,SAAS pricing and billing google cloud hierarchy  IAM VPC  compute engine scaling virtual machines through load balancer cloud DNS and CDN  google cloud storage options  storage classes and data transfer  cloud SQL  cloud spanner  Firestore Bigtable  comparing storage optio...