Skip to main content

(Linux Command Line) Part 4 – Commands Line for Network Configurationin Linux (CentOS, Ubuntu)

Linux is an open supply Operating System, basically used on servers and mainframes because of its prime balance, secured and unfastened. This is a component 4 of the serial Linux Command Line – Commands Line for Network Configuration in Linux (CentOS, Ubuntu)

Serial Linux Commands:

Commands Line for Network Configurationin Linux (CentOS, Ubuntu)

1) Commands Line for Network Configuration in Linux (CentOS, Ubuntu)

Ubuntu, CentOS, and different Linux working methods believe a community card as a tool. They save the configuration within the textual content record, then load it each time the device boots up. Each laptop wishes a stressed out or wi-fi Ethernet card, indexed within the /dev listing with a reputation starting with 3 letters Eth, as an example, eth0 for the primary community card, eth1 for the second one community card…
The Network configuration recordsdata of CentOS and Ubuntu are most often other. For instance, in Ubuntu, the community configuration record is saved in /and so forth/community/interface/ whilst in CentOS, it’s saved in /and so forth/sysconfig/network- Scripts/

1.1. Commands for Checking community data in CentOS and Ubuntu

COMMAND PURPOSE / DESCRIPTION
  ifconfig -a | grep eth Check the overall choice of community playing cards within the device
  ifconfig Check the configuration (MAC, IP cope with, gateway ..) of all of the community card within the gadget
(very similar to the IPCONFIG command in Windows)
  ifconfig card-name Check the configuration of the community card named card-name (eg: ifconfìg eth0)
  course -n Check the course of packets (very similar to the ROUTE command in Windows)

1.2. Commands for Network Configuration in CentOS and Ubuntu

COMMAND PURPOSE / DESCRIPTION
  sudo ifconfig eth0 up Enable the community card eth0 in Ubuntu
  sudo ifconfig eth0 down Disable the community card eth0 in Ubuntu
 ifconfig card IP1 netmask IP2 Set the community configuration for a community card. For instance, to set the IP for eth0 to 192.168.1.100, netmask= 255.255.255.zero with this command: ifconfig eth0 192.168.1.2 netmask 255.255.255.zero
Warning: This configuration can be reset/ deleted after the device re-start
 vi /and so forth/community/interfaces Set up the community configuration record in Ubuntu with VI Text Editor
 vi  /and so forth/sysconfig/network-scripts/ifcfg-eth0 Set up the configuration for community card Ethzero in CentOS with VI Text Editor
 /and so forth/init.d/networking restart Restart the community card in Ubuntu (to use adjustments)
 provider community restart Restart the community card in CentOS (to use adjustments)
  vi /and so forth/resolv Set call servers for CentOS and Ubuntu. For instance:
nameserver 8.8.8.8
nameserver 8.8.4.4
 course upload default gw 192.168.1.1 Set 192.168.1.1 because the default gateway in Ubuntu. In distinction to the command Add, we use the command Delete (as an example: course delete default gw 192.168.1.1)
  course upload -net 192.168.5.zero masks 255.255.255.zero dev eth0 Add a static routing to the community (for the community card Ethzero). In distinction to the command Add, we use the command Delete

1.3. Other Command Line for Networking in CentOS and Ubuntu

COMMAND PURPOSE / DESCRIPTION
 netstat Display community connections (similar in Windows)
 traceroute serverA Trace packet routing to serverA
 nslookup Query the area server (call server)
 rlogin serverA Connect to a faraway device
  telnet serverA Connect to a faraway device (higher interacting than rlogin)
 rcp fileX serverA Copy a record (fileX) from the faraway server (serverA)
 ftp
Transfer recordsdata between methods on a community
 rsh commandA
Run a command on a faraway device with out logging in
 ping serverA
Check connection to a faraway device (similar in Windows)
 liquid crystal display trail
Change native folder when logged in on faraway gadget
 mesg y/n
Set choices for different customers to put in writing messages for you
 write consumer
Send a message to some other consumer
 communicate consumer Allow 2 other people to speak with every different

Now I will be able to information intimately the best way to use the above instructions to configure the community for CentOS and Ubuntu

2) Guide the best way to Configure the community in CentOS and Ubuntu

Guide how to setup the network configuration in CentOS and Ubuntu

2.1. Configure community in Ubuntu

Step 1: Open the configuration record with VI textual content editor

sudo vi /and so forth/community/interfaces

Your display screen will show the community configuration like this:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
cope with 192.168.1.2
netmask 255.255.255.1.zero
gateway 192.168.1.1

=> You can exchange the “red text” above along with your IP

If you need to make use of a dynamic IP from the DHCP server, we claim the next instructions within the record /and so forth/community/interfaces:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

Step 2: Reboot or Restart the Networking provider through the use of the next command:

/and so forth/init.d/networking restart

Step 3: In maximum circumstances, your community instrument will paintings neatly after step 2. But in some case, it’s a must to config the Nameserver. Here’s how:

sudo vi /and so forth/resolv.conf

Enter the contents of the record as beneath then Save it

nameserver 8.8.8.8
nameserver 8.8.8.4

Done !!

2.2. Configure community in CentOS

Step 1: Use the command ifconfig to test your community playing cards

Step 2: Specify which community card to config (as an example: Ethzero), then open the configuration record with VI textual content editor

vi  /and so forth/sysconfig/network-scripts/ifcfg-eth0

Your display screen will show the community configuration like this:

DEVICE=eth0
TYPE=Ethernet
ONBOOT=sure
BOOTPROTO=none
BROADCAST=192.168.1.255
HWADDR=00:25:90:C3:65:BC
IPADDR=192.168.1.100
NETMASK=255.255.255.zero
GATEWAY=192.168.1.1
DNS1=8.8.8.8

=> You can exchange the “red text” above along with your IP
If you need to make use of a dynamic IP from the DHCP server, we wish to exchange the record contents to:

DEVICE=eth0
TYPE=Ethernet
ONBOOT=sure
NM_CONTROLLED=sure
BOOTPROTO=DHCP
DNS1=8.8.8.8

Step 2: Reboot or Restart the Networking provider through the use of the next command:

/and so forth/init.d/networking restart

All finished !!
Feel unfastened to go away a remark if you wish to have any lend a hand.


Find more at: Tech Cuber

Comments

Popular posts from this blog

KALLYAS – Creative eCommerce Multi-Purpose WordPress Theme

KALLYAS – The #1 Selling Most Enjoyable and Creative Multipurpose WordPress theme, responsive, light-weight, drag & drop visible web page developers & no coding required.Professional companies use Kallyas as a one web page website online images gallery company lodge recreational spa commercial development structure architect attorney regulation go back and forth reserving fashionable faculty schooling college lms youngsters health fitness center recreation listing tournament good looks way of life touchdown cellular market app activity product recreation highest admin jewellery meals eating place blank internet design yoga ux ui wedding ceremony watch hair salon barber era electronics delivery transportation logistics retina RTL Parallax Revolution slider. Community reinforce. Newspaper Membership Coming quickly charity summit motivational speaker keynote training trainer mentor instructor therapist coaching.With over 17,000 happy shoppers, the packages for Kallyas are virtual…

Tado Smart Radiator Thermostat Starter Kit Review

What is the Tado Smart Radiator Thermostat?German corporate Tado has a prestigious seat beside best avid gamers akin to Hive and Nest in the United Kingdom’s sensible thermostat marketplace, however now it desires to take heating your house to an entire new degree.Its sensible radiator thermostat replaces a normal radiator thermostat to mean you can customize the temperature in separate rooms of your house from an app in your telephone. In sensible house language that is referred to as “zoned heating”.The Tado Smart Radiator Thermostat Starter Kit comprises an web bridge and two sensible radiator thermostats; you’ll be able to purchase further thermostats for £59 each and every if you wish to equipment out greater than two radiators. I used the Starter Kit at the side of one further sensible radiator thermostat to regulate the 3 radiators in my small area.So, is zoned heating with Tado the way forward for sensible heating?Tado Smart Radiator Thermostat Starter Kit – Features and Desig…

The Best Smartphones – TechSpot

Throughout the years we’ve reviewed dozens of smartphones and were given fingers on time with masses others. The excellent information is that as smartphones have matured, they have got grow to be so excellent with regards to and design that it’s getting tougher to pick out one thing you’ll really be apologetic about… or in the event you’re the glass part empty kinda particular person, they’ve grow to be so excellent that selecting the one who’s proper for you’ll be able to be a difficult job.You’ve learn the evaluations and feature shaped your personal reviews at the units you have owned and lately personal, however with our huge get admission to to units, the finest smartphones characteristic is supposed to focus on the stuff that issues, what we would purchase for ourselves primarily based in quite a few elements (specifically worth level) and thus make it more uncomplicated so that you can purchase the finest imaginable instrument.Best Overall 2017 has introduced on one of the vita…