7. Redhat Linux : RHCE 6
Firewall
* iptables used to configure firewall settings
* iptables -t filter/NAT -I INPUT/OUTUT -s/-d Source_IP/Destination_IP -P tcp/udo/icmp --dport Destn_Port_No -j accept/reject/drop
* /etc/sysconfig/iptables
* 6535 ports are there in server
* /etc/services lists all the port infos
DHCP
* port 68
* range giving for dynamic IPs are called leases
* can be used for IPV4 and IPV6(dhcpd,dhcpd6)
Steps to do at server:
---------------------
1. yum install dhcp -y
2. cp /usr/share/doc/dhcp-4.1.1/dhcp.conf.sample /etc/dhcp/dhcpd.conf
3. vim /etc/dhcp/dhcpd.conf
line 32 give 'subnet server_ip netmask netmask{ range start_IP End_IP}'
comment all other lines except line 8,9,22, and 32
4. service NetworkManager restart
5. service network restart
6. route -n
7. route add default gw server_ip
Steps to do at client:
---------------------
1. service NetworkManager restart
2. service network restart
3. route add default gw 192.168.3.1
/*
Commands for the day:
--------------------
* iptables -t filter -I INPUT -s 192.168.2.0/24 -p tcp --dport 22 -j REJECT
* iptables -t filter -I INPUT -s 192.168.2.0/24 -p icmp -j REJECT
* service iptables save
* nslookup ip
* dig ip
* ps : process status
* ps a : process status
* ps u : process status
* ps x : process status
* top : task manager
pid
user
priority(depends on NI, inversily proportional)
Nice value
Virtualization Image
residence value(RAM)
Shared value(between swap and ram)
Status
* renice -19 PID : to re allocate nice value(+19 to -19)
* vmstat : virtual memory statistics (eg. vmstat 2 5 :- 2 processes 5 programs)
* cat /proc/cpuinfo
* cat /proc/meminfo
* cat /proc/cmdline
* iostat
* sar : system activity report
* ifconfig eth0:0
*/