5. Redhat Linux : RHCE 6
Networking
Clases in Network
-----------------
* Class A : 1-126 netmask:255.0.0.0
* Class B : 128-191 netmask:255.255.0.0
* Class C : 192-223 netmask:255.255.255.0
* Class D : 224-239 netmask:no netmask
* Class E : 240-254 netmask:no netmask
* loopback address : 127.0.0.0
* broadcast address : 255.255.255.255
Hostname
--------
* change permenanlty in /etc/sysconfig/network
* /etc/sysconfig/network-scripts/ifcfg-eth0 stores ifconfig details of eth0
* /etc/sysconfig/network-scripts/ifcfg-eth1 stores ifconfig details of eth1
* /etc/resolve.conf stores DNS details
* /etc/services stores port infos
* /etc/rc5 stores apps to be started at shell startup and ending
Network Services
----------------
NFS (Network File Sharing Service)
----------------------------------
* used for UNIX to UNIX file sharing(NFS V3)
* port used by NFS is 2049
* package for NFS is nfs-utils
* daemon(process that runs continoeusly in the background) is nfs
* /etc/exports stores the files to be shared
/store(directory to share) domain.com(rw,sync)
/store(directory to share) desktop1.domain.com(rw,sync)
/store(directory to share) ip (rw,sync)
/store(directory to share) 192.168.0.1/24(rw,sync)
/store(directory to share) 192.168.0.1-12(rw,sync)
* well-known ports : connection oriented(tcp)
* short service ports : udp
* ping command sends ICMP packets
Steps to do:
-----------
1. Go to server and edit /etc/exports file:
/directory_to_share client_ip(rw,sync)
service nfs restart
2. Go to client and see 'showmount -e server_ip'
create a directory and mount it
mount -t nfs server_ip:/directory_shared /new_directory@client
Auto File System:
----------------
* used for Unix to unix file sharing
* files need to be shared should be placed any where
* give the location in /etc/auto.misc
* enable the changes update in /etc/auto.master
CIFS (Samba)
------------
* used for UNIX to Windows file sharing and NFS V4
vsftpd:
------
* used for UNIX to UNIX file sharing
* Very secure file transfer protocol
* port 21
* config file /etc/vsftpd/vsftpd.conf
* place sharing files in /var/ftp/pub
httpd:
-----
* used for UNIX to UNIX file sharing
* port 443 for https
ssh:
---
* Secure shell uses port 22 and RSA algorithm for encryption
* open-ssh package
* to get documents sshd
* /etc/ssh/ssh_config is the config file:
DenyUsers user1,user2
AllowUsers user1,user2
* scp(secure copy)
scp source destination
scp /root/file root@192.168.x.x:/file
scp root@192.168.x.x:/file /root/file
* ssh without password:
ssh-keygen at client side produce public keys and private keys at /.ssh
copy public key to server using 'ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.x.x'
/etc/ssh/sshd_config edit for permitrootlogin=yes and login without password enabled
telnet:
------
/*
Commands for the day:
--------------------
* ethtool eth0 : checks the physical connectivity of network
* ifconfig etho ipaddress : set static ip
* ifup eth0 : eth0 enable
* ifdown eth0 : eth0 disable
* ping ipaddress : ping status
* ping 0 : loopback ping
* chkconfig nfs : used for enabling at start level
* chkconfig nfs on : used for enabling at start level in the present run level
* chkconfig --level 34 nfs off : used for disabling at levels 3 and 4
* chkconfig --level 34 nfs on : used for enabling at levels 3 and 4
* chkconfig --list nfs : used for listing all levels
* service nfs restart : restart nfs
* showmount -e server_ip : shows the nfs files shared by server
* mkdir directory
* mount -t nfs server_ip:/store directory : to mount the nfs shared files in the client
* system-config-network : GUI tool to configure networking(permenant)
* service autofs reload : restart autofs
* scp source destination : secure copy
*