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

Bass Fishing Connection

👍 Product: Bass Fishing Connection 👉 Click right here to get Bass Fishing Connection at discounted worth whilst it is nonetheless to be had… Product Description: Boatlanes Downloadable Gps Way Points Marking Actual Boat-running Lanes On Texas’ Premier Bass Fishing Lakes: Lake Fork, Sam Rayburn, T-bend. Selling Like Crazy! 50% To Affiliates Great Conversion Rate Exceptional Customer Service/product Support! All orders are secure by means of SSL encryption – the best business usual for on-line safety from relied on distributors. 👉 Click right here to get Bass Fishing Connection at discounted worth whilst it is nonetheless to be had… Find more at: Tech Cuber

Health PLR Articles | Health Private Label Rights

👍 Product: Health PLR Articles | Health Private Label Rights 👉 Click right here to get Health PLR Articles | Health Private Label Rights at discounted worth whilst it is nonetheless to be had… Product Description: A Total Of 889 Health Plr Articles For 5 Hot Health Niche Market Categories That Are Currently High On Demand. Market Niches Include Health Nutrition, Health Food, Health Diet, Natural Health And Health Supplement. A Must-have For All Online Marketers!!! All orders are safe via SSL encryption – the absolute best trade usual for on-line safety from relied on distributors. 👉 Click right here to get Health PLR Articles | Health Private Label Rights at discounted worth whilst it is nonetheless to be had… Find more at: Tech Cuber

10 Amazing Fun Facts About the iPhone [Infographics]

Apple’s iPhone has been evolved over the years and made some revolution in Smartphone industry . iPhone has got more than 200 registered patents , which makes it stand out of the crowd. Everybody had been talking about integrating music player functionality into phones for years, but it didn’t catch on among the majority of smart phone users until the iPhone . Apple even made an iTunes mobile application for other handset makers like Motorola to pre-install on phones. But most people didn’t bother. After the iPhone, music on phones became standard for most people. iPhone made a remarkable revolution in way people listen to music . 10 Most Interesting Facts About the iPhone The Apple iPhone may be the most influential consumer gadget ever, changing the way phones work, changing the way people see the world and changing human culture. iPhone changed the way how people used a cell phone , from the way they sms/take photos/videos/view pictures and listen to music.  In this article,