Showing posts with label centos. Show all posts
Showing posts with label centos. Show all posts

Linux Network Configuration

By // No comments:

Linux Network Configuration in Linux/Centos


Today we will see in this post that How to set up network configuration in Linux/centos such as How to assign Static ip address, How to assign gateway, how to assign DNS, How to change hostname in linux. It's very easy to assign static ip address, DNS, Gateway and Host name. Please read full articles if you face any problem regarding this articles so please leave comments or drop email within 24 hours you will get reply by our team.

Please leave comment if article good and share it also.



To check hostname in Linux/Centos:

[root@localhost ONS]# hostname

To change hostname temporary in Linux/Centos:

[root@localhost ONS]# hostname newhostname

To change hostname permanent in Linux/Centos:

[root@localhost ONS]# vim /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=localhost.local --------> please change localhost.local into newhostname.local (according to your requirement)

To restart network service in Linux/Centos:

[root@localhost ONS]# service network restart



To check ip address in Linux/Centos:

[root@localhost ONS]# ifoconfig

To assign static ip address temporary in Linux/Centos:

[root@localhost ONS]# ifconfig eth0 192.168.1.250 netmask 255.255.255.0

To assign static ip address permanent in Linux/Centos:

[root@localhost ONS]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

View this detail

DEVICE="eth0"
BOOTPROTO="DHCP" 
HWADDR="00:0C:29:56:4E:9E"
MTU="1500"
NM_CONTROLLED="yes"
ONBOOT="yes"

Change some configuration:

DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:0C:29:56:4E:9E"
IPADDR=192.168.1.253
NETMASK=255.255.255.0 or PREFIX=24
MTU="1500"
NM_CONTROLLED="yes"
ONBOOT="yes"

To restart network service in Linux/Centos: 

[root@localhost ONS]# service network restart

To assign Gateway ip address in Linux/Centos: 

[root@localhost ONS]# vim /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=localhost.local
GATEWAY=192.168.1.1

To assign DNS ip address in Linux/Centos:

[root@localhost ONS]# vim /etc/resolv.conf

nameserver 192.168.1.1 or 8.8.8.8

To restart network service in Linux/Centos: 

[root@localhost ONS]# service network restart

Note: Please don't forgot to restart service of network because it will update own recent changes.

Hope this will help to all of you and resolved your all query if you have any query or question so you may ask on email our email account (onlinenetworkssolution@gmail.com) or leave comment on page.

Most useful basic Linux/Centos command

By // No comments:

Most useful basic Linux/Centos command


Today we will see in this post that basic command in Linux/Centos. It's very easy to create, change, modify and delete files and directory. Please read full articles if you face any problem regarding this articles so please leave comments or drop email within 24 hours you will get reply by our team.

Please leave comment if article good and share it also.



Please follow all command of linux:

To create a directory(dir):

[root@localhost ONS]# mkdir ram

To enter in any directory:

[root@localhost ONS]# cd ram

To come out from directory:

[root@localhost ONS]# cd ..

To come in top level directory from any directory:

[root@localhost ONS]# cd /

To check the current working directory:

[root@localhost ONS]# pwd


To clear the screen:

[root@localhost ONS]# clear

To check the list of files and directory:

[root@localhost ONS]# ls

To check the list of files and directory permission:

[root@localhost ONS]# ls -l

To delete a blank directory:

[root@localhost ONS]# rmdir ram

To remove directory with his subdirectory:

[root@localhost ONS]# rm -r ram

To check the terminal:

[root@localhost ONS]# tty

To check how many users login on computer:

[root@localhost ONS]# who

To check currently login user on your prompt:

[root@localhost ONS]# whoami

To Eject the CD/ROM and DVD/ROM:

[root@localhost ONS]# eject

To insert the CD/ROM and DVD/ROM:

[root@localhost ONS]# eject -t

To mount the CD/ROM and DVD/ROM:

[root@localhost ONS]# mount /dev/dvdrom /mnt

To dismount the CD/ROM and DVD/ROM:

[root@localhost ONS]# unmount /dev/dvdrom /mnt


Hope this will help to all of you and resolved your all query if you have any query or question so you may ask on email our email account (onlinenetworkssolution@gmail.com) or leave comment on page.