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

The Power of Man The Strongest Man

The Power of Man The Strongest Man The Power of Man The Strongest Man The Power of Man The Strongest Man Tech Cuber was found in 2012 by a group of who’d love mobile & internet technology. We aim to bring to visitors/users useful knowledge and experiences by many articles of tips and tricks for computer, mobile and other devices; guide how to install and config software, hardware, networking and make money online; product review and technology news. - Website: http://techcubers.com - Google+: https://plus.google.com/+Techcubers - Youtube: https://youtube.com/channel/UC1YcFbt95qPBaE_Mfn3ua9w - Facebook: https://facebook.com/techcubers - Twitter: https://twitter.com/techcubers - Blogger: https://techcubers.blogspot.com - Tumblr: https://techcubers.tumblr.com - WordPress: https://techcubers.wordpress.com The Power of Man The Strongest Man xmen power man strongest man big man biggest man x men x men days of future past cast x men days of future past x men movies xmovies x men film ...

10 Worst Circus Disasters | HowStuffWorks

Circuses are widely known as bad places. In fact, that is part of the joys, isn’t it? Nobody is enthusiastic about going to a circus that promises a subdued time. Instead, we wish to be on the edge of our seats, in a position to gasp in awe at the stunts performed or the ferocity of the animals. Unfortunately, that also means problems can transfer very mistaken at the circus. If all the conceit of a show is devious possibility, you upper believe that now and again possibility is going to win. And while it’s going to seem to be tales of circus woe are edging in opposition to risk free, it’s price pointing out that the screw u.s.a.we will be able to discuss inside the following pages don’t seem to be any trifling affair simply because they took place in a fun environment. There’s some stunning horrific traumas in circus history, and we may not be shy. But let’s get began with a modern circus disaster that, while horrific, didn’t result in loss of existence. 10: Providence Hair Hanger...

10 Ways to Get Rid of Greedy and Annoying Relatives

People in every single place the worldwide, specifically Indians, are blessed (no pun supposed) with a huge number of kinfolk from all corners of the sphere. We all have uncles, aunts, cousins, grandparents and so forth and so forth. Though there are few ones we don’t like, on the other hand have you ever ever ever given a thought how boring lifestyles would were without the ones kinfolk? There are ones we don’t like, there are few we love and easily their mere presence brightens up our day, there are some who don’t in truth bother us. But that’s what lifestyles is all about, isn’t it? We can just about categorize all our kinfolk in a lot of categories, the ‘agony aunt’, ‘the foreign return cousin’, ‘the cheek pulling uncle’. It is funny that how we hate the ones other folks, on the other hand they’re those that make our family unique and our family outings and gatherings stress-free. It is gorgeous as long as they’re messing along side your other cousins another way you siblings. The ...