Monday, 22 January 2018

NETWORK BASICS:



In the N/W system maintains the FQDN (Fully Qualified Domain Name).
FQDN = Host Name + Domain Name

To chance the Host Name
1) Temporarily :
To check the hostname
# hostname
To change the hostname
# hostname server.bharath.com
2) Permanently :
To change the hostname Permanently:
# vi /etc/sysconfig/network
Networking=yes
Hostname=server.bharath.com
Note : For avoiding graphical problems the host name should be change at
below configuration file also
# vi /etc/hosts
192.168.0.2 server.bharath.com
* To check the ip address
# ifconfig eth0
To change the IP address Temporarily
# ifconfig eth0 <ipaddress> netmask <default subnetmask> up
ex : # ifconfig eth0 192.168.0.50 netmask 255.255.0 up
To change the IP address permanently
We can change the IP address permanently in CLI based as well as GUI
based
At GUI we can change ip address permanently using below commands
1) # neat
2) # system-config-network &
At CLI we can change ip address permanently using below commands
1) neat -tui
2) system -config-network-tui
3) setup
4) netconfig
To assign the virtual ipaddress
# netconfig --device eth0 <virtual ip> up
ex : netconfig --device eth0 192.168.0.100 up
To check the NIC card detected or not
# ethtool <ethernetcard>
ex : ethtool eth0
To disable the NIC card
# ifdown eth0
To enable NIC card
# ifup eth0
For NIC card :
# cd /etc/sysconfig/network-scripts/
# Is
# cat ifefg-eth0
For DNS : vi /etc/resolv.conf
nameserver <dns-ip-Adrs>
ex : nameserver 192.168.0.1
To Manage the Services Temporarily
To stop/start/restart the services
# service <service name> <stop/restart/start>
To stop the nfs service
# service nfs stop
To check the particular service status
# service <servicename> status
ex : # service nfs status
To check all the services status:
# service --status-all
To Manage the services Permanently:
To check the all service status :
# chkconfig --list
To check the particular service status
# chkconfig --list <servicename>
# chkconfig --list nfs
To enable /disable the service :
# ckconfig --level <run levies> <service name> <on/off>
ex: # chkconfig --level 146 nfs off
The above example disables the nfs service in run levels 1,4,6
# chkconfig --level 235 nfs on
The above example is used to enable the nfs service in run levels 2,3,5
To check the services accessed by the foreign systems :
# netstat -ant
To see port numbers of all services
# vi /etc/services
To login remotely using ssh
# ssh <destination system ip>
Ex : ssh 192.168.0.2 (to logon to the system 192.168.0.2 using ssh)

No comments: