Wednesday, August 29, 2012

How to Configure DHCP Server


Configure DHCP Server
  • Subnet and netmask should be 192.168.0.0 255.255.255.0
  • Gateway Should be 192.168.0.254
  • DNS Sever Should be 192.168.0.254
  • Domain Name should be example.com
  • Range from 192.168.0.10-50

Configure dhcp server

In this example we will configure a dhcp server and will lease ip address to clients.
For this example we are using three systems one linux server one linux clients and one window clients.
dhcp rpm is required to configure dhcp server. check it if not found then install
rpm
Now check dhcpd service in system service it should be on
#setup
Select  System service
from list [*]dhcpd

To assign IP to dhcp server

DHCP server have a static a ip address. First configure the ip address 192.168.0.254 with netmask of 255.255.255.0 on server.
Run setup command form root user
 #setup 
setup
this will launch a new window select network configuration
network configurations
now a new window will show you all available LAN card select your LAN card ( if you don't see any LAN card here mean you don't have install driver)
select lan devices in setup
assign IP in this box and click ok
assign ip address
click on ok, quit and again quit to come back on root prompt.
restart the network service so new ip address can take place on LAN card
 #service network restart 
main configuration file of dhcp server is dhcpd.conf. This file located on /etc directory. If this file is not present there or you have corrupted this file, then copy new file first, if ask for overwrite press y
cp dhcpd sample file
now open /etc/dhcpd.conf
vi dhcpd
default entry in this file look like this 
dhcpd.conf
make these change in this file to configure dhcp server
remove this line # - - - default gateway
set option routers to 192.168.0.254
set option subnet-mask to 255.255.255.0
option nis domain to example.com
option domain-name to example.com
option domain-name-servers to 192.168.0.254
range dynamic-bootp to 192.168.0.10 192.168.0.50;
After change this file should look like this 
dhcpd.conf

excluding the above setting remaining all lines make it comment 

Linux Client configuration

Client configuration is very easy and straightforward. All you need to do is set ip address to dynamic in the properties of lan card. In linux
#setup
select  network configuration from menu list
Select  lan card and enter on ok
Select  USE DHCP and enter on ok
Now click on  quit
and  quit to come back on root prompt
Now restart the network service to obtain ip from dhcp server
service network restart

Window Client configuration

To configure windows system as dhcp clients open lan card properties and select tcp/ip and click on properties and setobtain ip address automatically
lan card porperties
Go on command prompt and check new ip address 
ipconfig

Check lease on DHCP server

you can check allocated address on server.
 cat
cat lease

Configure nfs server


Configure nfs server

  • A linux server with ip address 192.168.0.254 and hostname Server
  • A linux client with ip address 192.168.0.1 and hostname Client1
  • Updated /etc/hosts file on both linux system
  • Running portmap and xinetd services
  • Firewall should be off on server
We suggest you to review that article before start configuration of nfs server. Once you have completed the necessary steps follow this guide.
Three rpm are required to configure nfs server. nfs, portmap, xinetd check them if not found then install
rpm
Now check nfs, portmap, xinetd service in system service it should be on
#setup
Select  System service
from list
[*]portmap [*]xinetd [*]nfs
Now restart xinetd and portmap service
service restart
To keep on these services after reboot on then via chkconfig command
chkconfig
After reboot verify their status. It must be in running condition
service status
now create a /data directory and grant full permission to it
mkdir
now open /etc/exports file 
vi exports
share data folder for the network of 192.168.0.254/24 with read and write access 
editing in exports
save file with :wq and exit
now restart the nfs service and also on it with chkconfig 
service nfs restart
also restart nfs daemons with expotfs 
exportfs
verify with showmount command that you have successfully shared data folder
showmount

configure client system

ping form nfs server and check the share folder 
showmount
now mount this share folder on mnt mount point. To test this share folder change directory to mnt and create a test file 
mount server directory
After use you should always unmount from mnt mount point
unmount
In this way you can use shared folder. But this share folder will be available till system is up. It will not be available afterreboot. To keep it available after reboot make its entry in fstab
create a mount point, by making a directory 
mkdir
now open /etc/fstab file 
vi fstab
make entry for nfs shared directory and define /temp to mount point
file fstab


Configure ssh server


Configure ssh server


  • A linux server with ip address 192.168.0.254 and hostname Server
  • A linux client with ip address 192.168.0.1 and hostname Client1
  • Updated /etc/hosts file on both linux system
  • Running portmap and xinetd services
  • Firewall should be off on server
We suggest you to review that article before start configuration of ssh server. Once you have completed the necessary steps follow this guide.
Three rpm are required to configure ssh server. openssh-server, portmap, xinetd check them if not found then install
rpm
Now check sshd, portmap, xinetd service in system service it should be on
 #setup
 Select  System service from list
 [*]portmap
 [*]xinetd
 [*]sshd 
Now restart xinetd and portmap and sshd service
service restart
ssh restart
To keep on these services after reboot on then via chkconfig command
chkconfig
After reboot verify their status. It must be in running condition
service status
Create a normal user named bob

On Linux client

ping from ssh server and run ssh command and give root password
root login
By default ssh command will enable root session. If you want to login from normal user then specify his name with -l options.
ssh 192.168.0.254 -l bob

Tuesday, August 28, 2012

How to setup Telnet server in RHEL

For this example we are using three systems one linux server one linux clients and one window clients. To complete these per quest of telnet server
    •  linux server with ip address 192.168.0.254 and hostname Server
    • A linux client with ip address 192.168.0.1 and hostname Client1
    • A windows xp system with ip address 192.168.0.2 and hostname Client2
    • Updated /etc/hosts file on both linux system
    • Running portmap and xinetd services
    • Firewall should be off on server
Four rpm are required to configure telnet server. telnet, telnet-server, portmap, xinetd check them if not found then install

rpm

Now check telnet, portmap, xinetd service in system service it should be on
 #setup
Select  System service from list
[*]portmap
[*]xinetd
[*]telnet 



Now restart xinetd and portmap service

service restart
To keep on these services after reboot on then via chkconfig command
chkconfig
After reboot verify their status. It must be in running condition
service status
Create a normal user named user1

On Linux client

ping from telnet server and run telnet command and give user name and password






On Window client

ping from telnet server and run telnet command
telnet
Give user name and password







How to enable root login from telnet server

On linux server open file securetty
securetty
In the end of file add pts/0 to enable one telnet session for root. if you need to open more telnet session for root and add morepts/1 pts/2 and so on.
editing in securetty
Now restart xinetd and portmap service
service restart




Verfiy from window by login from root
root login telnet



Monday, August 27, 2012

Linux IP configuration and Network configuration


Linux ip configuration and Network configuration


Every node participating in networking needs a valid IP address. On Linux command prompt IP address is assigned by a network configuration window. This window can be invoked by selecting network configuration sub menu form setupcommand or directly executing system-config-network commands.
Run setup command form root user
setup
this will launch a new window select network configuration
network configurations
now a new window will show you all available LAN card select your LAN card ( if you don’t see any LAN card here mean you don’t have install driver)
select lan devices in setup
assign IP in this box and click ok
assign ip address
click on ok, quit and again quit to come back on root prompt.
Alternately you can use system-config-network command directly to invoke this setup window
system-config-network
whatever change you made in network configuration will not take place till you restart the LAN card
service network restart

ifconfig

ifconfig
The ifconfig command will display the configuration of all active Ethernet card. Without specifying any parameter this command will show all active Ethernet card. if you want to see the configuration of any specific Ethernet card then use the name of that card as the command line arguments. for example to show the IP configuration on loop back Interface execute this command.
ifconfig lo

ifup/ifdown

ifup ifdown etho
Each installed network adapter has a corresponding ifcfg-* file in /etc/sysconfig/network-scripts. You can activate or deactivate that adapter with the ifup and ifdown commands. Either of the following commands will activate the eth0 network adapter: