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

Review All about Honor post 8

Who is honor-8 have the most brilliant Smartphone we ever checked with extremely reflective glass, which gives off an Aurora effect as it bounces light around at all angles. This flashy Android phone will make himself in a crowd, even if its 5.2-inch display is rather flat next to the winding. It is elegant in its own way. Review All about Honor post 8 Even better: for every purchase of a cheap mobile phone, Huawei honor budget-friendly sub brand brings a lot of the same specifications and performance as Samsung devices, but in the medium price range. Honor 8 costs just as much as the recent and, and works in a similar way only on GSM carriers like AT & T and T-Mobile in the United States.” This is in the same class. It is therefore automatically the third wheel on the basis of his later launch date. And illogical software selection–such as no app drawer – make it that “Oh, we are not with him” nerd of the group. It’s okay, it does other things properly.” Like the ones which...

When followers take their love for Twitch streamers too some distance

It was once one within the morning when the Twitch streamer Ellohime heard a knock at his entrance door. He have been grinding away at a PC sport that evening in December 2015 whilst his toddler daughter and fiancée slept. His 22-year-old brother was once crashing within the central Florida house, too, and it wasn’t unparalleled for him to ask buddies over at ordinary hours. Ellohime left his table and went downstairs to the door. “Hello?” got here a voice from out of doors. “Hello,” Ellohime spoke back. “Hello?” the stranger mentioned, his voice shaky and skinny. It took a couple of extra back-and-forth responses prior to Ellohime discovered the fellow on the door wasn’t pronouncing “Hello.” He was once pronouncing “Ello.” This was once a fan. By now, his fiancée was once wide awake. Ellohime ran up the steps to the second one ground, the place he may just see right down to the entrance porch. “I saw a very small, skinny kid,” he says. “His face was all red.” He walked downstairs o...