RHCE Flashcards
Check current rutes
route
create a permanent rule to 172.168.1.0 using eth0
/etc/sysconfig/networ-scripts/route-eth0
172.168.1.0 via 192.168.1.100 dev eth0
restart interface
Configure server as NAT
/etc/sysctl.conf --> net.ipv4_forward =1 sysctl -p --> to read changes iptables: -A FORWARD -i eth1 -o eth0 -j ACCEPT -A FORWARD -i eth0 -o eth1 -j ACCEPT -t nat -I POSTROUTING -o eth0 -j MASQUERADE
test NAT working from other server
make sure testing server uses the other as GW
get list of wrappers
strings -f /usr/sbin/* | grep hosts_access
allow all traffic from example.net, deny rest
host.allow:
ALL : .example.net (dont forget initial .)
host.deny:
ALL : ALL
allow ssh from subnet 192.168.1.0 except 192.168.1.101
sshd : 192.168.1.0/255.255.255.0 EXCEPT 192.168.1.101 [or]
sshd : 192.168.1. EXCEPT 192.168.1.101
make an RPM that packages iptables.sh
install rpmdevtools create folder package-1.0 compress folder rpmdev-setuptree rpmdev-newspec rpmbuild --b -v SPECS/mytest.spec
test RPM package
rpm -ivh package
configure ISCSI init to 192.168.1.200
install iscsi-initiator-utils
iscsiadm -m discoverydb -t st -p host -D
make sure “iscsi”service is on
partition and mount as usual (fstab options = _netdev 0 0)
make iscsi permanent and test after reboot
as any other ext4 drive
create a report that shows CPU, blah blah usage for the last 5 mins in intervals of 1m
sar -u 1 5
generate report from a sar log
sadf -d /var/log/sa/sa32
change sas data capture for 11pm
/etc/cron.d/sysstat and restart service and on
configure 101 to send logs to 100
100: open ports tcp/udp 514
/etc/rsyslog.conf uncommend 4 ports entries
101:
/etc/rsyslog.conf: . @@blah.100
test logger at 101
logger -p warn “textto”
configure a Vhost www.mysite.com with root folder at /www/mysite/html
create folder and setup selinux permissions
create Vhost at httpd.conf
test Vhost
make sure hosts entry is in
create Vhost www.mysite2.com
nada