Networking
======================================================================================
classes of IP address
check first octect of IP address
A => 1 to 126 / 255.0.0.0
B => 128 to 191 / 255.255.0.0
C => 192 to 223 / 255.255.255.0
eg.
192.168.1.0 => network ID 192.168.1 And host ID = 0
================
virbr0 Link encap:Ethernet HWaddr 52:54:00:C3:B1:30
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
================
1> Steps to assign dedicated IP to server
i> #setup
Or
#system-config-network
ii> select “network configuration” => device configuration => eth0 ( or required interface/LAN card) => static IP ( type the IP) eg. 192.168.122.10 and other infomation ( clear the ‘*’ from DHCP ) => OK => save and quit.
iii> #service network restart
iv> #chkconfig network on
v> Disable the n/w manager
#vim /etc/sysconfig/network-scripts/ifcfg-eth0
NM_CONTROLLED = no ( By default Yes)
ONBOOT = yes
:wq
vi> disable LAN card
#ifdown eth0
vii> Enable LAN card
#ifup eth0
viii> cross check the assigned IP
#pifconfig
ix> finally check connectivity
#ping -c 3 192.168.122.10 —c(provide number of ping response count if want )
OR
#ping 192.168.122.10
============================================================================
2> Assign IP temporarily
#ifconfig eth0 192.168.122.20
note : after reboot or n/w restart the temporary assign IP will lost
============================================================================
3> Creating virtual LAN card
By using this, we can assign additional IP to same LAN card.
#ifconfig eth0:1 192.168.122.30
==============================================================================
4> Check hostname
#hostname
Change hostname temporarily
#hostname example.com
Change hostname permanently
#vim /etc/sysconfig/network
HOSTNAME=server.example.com
:wq
==================================================================================
5> Set domain name
#domainname example.com
Recheck domain name
#nisdomainname
Add entry to ‘hosts’ file
#vim /etc/hosts
127.0.0.1 example.com
:wq
====================================================================================
6> Add DNS member
#vim /etc/resolv.conf
search example.com
:wq
Now you can able to ping domain name
====================================================================================
Sample information in eth0 file
#cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.122.10
NETMASK=255.255.255.0
GATEWAY=192.168.122.10
DNS1=192.168.122.10
:wq
=====================================================================================
Leave a Reply
You must be logged in to post a comment.