This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| gateway_centos_7 [2015/03/27 10:03] – herwarth | gateway_centos_7 [2016/01/01 14:05] (current) – herwarth | ||
|---|---|---|---|
| Line 13: | Line 13: | ||
| </ | </ | ||
| systemctl restart sshd | systemctl restart sshd | ||
| + | systemctl disable kdump | ||
| <code - / | <code - / | ||
| herwarth ALL=(ALL) ALL | herwarth ALL=(ALL) ALL | ||
| Line 50: | Line 51: | ||
| UUID=aa0c6edb-9b36-424c-b331-d7989db83218 | UUID=aa0c6edb-9b36-424c-b331-d7989db83218 | ||
| ONBOOT=yes | ONBOOT=yes | ||
| - | IPADDR0=10.0.0.2 | + | IPADDR0=10.108.108.5 |
| PREFIX0=24 | PREFIX0=24 | ||
| HWADDR=00: | HWADDR=00: | ||
| Line 64: | Line 65: | ||
| </ | </ | ||
| + | =====MSMTP===== | ||
| + | We want to be able to mail using an mailserver on the outside and not using an internal one. This is for reporting only, so no incoming mail required. | ||
| + | ====Installation==== | ||
| + | yum remove postfix | ||
| + | yum install msmtp mailx | ||
| + | ====Configuration==== | ||
| + | <code - / | ||
| + | account default | ||
| + | tls on | ||
| + | tls_trust_file / | ||
| + | auth on | ||
| + | host mail.helux.nl | ||
| + | port 587 | ||
| + | user noreply@helux.nl | ||
| + | from noreply@helux.nl | ||
| + | password < | ||
| + | </ | ||
| + | chmod 644 / | ||
| + | <code - / | ||
| + | default: noreply@helux.nl | ||
| + | </ | ||
| + | ln -s /bin/msmtp / | ||
| + | =====ARCCONF===== | ||
| + | This is for monitoring the hardware health of the RAID controller. | ||
| + | |||
| + | ====Installation==== | ||
| + | Download the necessary software [[https:// | ||
| + | Unzip it and we need only the following: remote-arcconf-7.31-18856.x86_64.bin | ||
| + | chmod 755 remote-arcconf-7.31-18856.x86_64.bin | ||
| + | ./ | ||
| + | ====Configuration==== | ||
| + | <code - / | ||
| + | #!/bin/bash | ||
| + | export ARCCONF_PATH=/ | ||
| + | |||
| + | DATE=$(date +"%F (%H: | ||
| + | RAID=/ | ||
| + | RAIDSTATUSFILE=/ | ||
| + | ARCCONF=/ | ||
| + | RECIPIENT=" | ||
| + | $ARCCONF getconfig 1 al > $RAID | ||
| + | CTRLSTAT=$(grep ' | ||
| + | |||
| + | ## Optimal | ||
| + | echo " | ||
| + | echo " | ||
| + | echo " | ||
| + | CTRLBATINFO=$(grep -A 2 ' | ||
| + | CTRTEMP=$(grep ' | ||
| + | CTRTEMPERATURE=$(grep ' | ||
| + | ## Normal | ||
| + | echo " | ||
| + | echo $CTRTEMPERATURE >> | ||
| + | LOGICSTAT=$(grep ' | ||
| + | ## Optimal | ||
| + | echo " | ||
| + | LOGICSTR=$(grep ' | ||
| + | ## No | ||
| + | echo " | ||
| + | |||
| + | # number of drives | ||
| + | DRIVESNO=$(grep -B 1 -A 1 ' | ||
| + | |||
| + | echo " | ||
| + | if [ " | ||
| + | # when everything is OK send the status message on Wednesday and Saturday (Wed / Sat) on 02.00 hrs, which is set to run in CRON every hour (15 * * * * / | ||
| + | # if you don't want to get emails if nothing wrong then don't use this block if ... fi | ||
| + | # this should be all in 1 line | ||
| + | if ( [ " | ||
| + | i=" | ||
| + | while [ $i -lt " | ||
| + | CURDRIVE=DRIVE$i | ||
| + | # this should be all in 1 line | ||
| + | echo " | ||
| + | i=$[$i+1] | ||
| + | done | ||
| + | # this should be all in 1 line | ||
| + | mail -s " | ||
| + | fi | ||
| + | $(rm $RAID) | ||
| + | elif [ " | ||
| + | ## SENDTHEMAIL | ||
| + | cat $RAID >> | ||
| + | # this should be all in 1 line | ||
| + | mail -s "RAID FAILURE - Adaptec RAID error $DATE !" $RECIPIENT < $RAIDSTATUSFILE | ||
| + | else | ||
| + | cat $RAID >> | ||
| + | # this should be all in 1 line | ||
| + | mail -s "RAID FAILURE - Adaptec RAID error $DATE !" $RECIPIENT < $RAIDSTATUSFILE | ||
| + | fi | ||
| + | </ | ||
| + | =====DHCP server===== | ||
| + | ====Installation==== | ||
| + | yum install dhcp | ||
| + | ====Configuration==== | ||
| + | <code - / | ||
| + | # DHCP Server Configuration file. | ||
| + | # see / | ||
| + | # see dhcpd.conf(5) man page | ||
| + | # | ||
| + | # option definitions common to all supported networks... | ||
| + | |||
| + | option domain-name " | ||
| + | option domain-name-servers 10.108.108.15; | ||
| + | option local-proxy-config code 252 = text; | ||
| + | default-lease-time 86400; | ||
| + | max-lease-time 172800; | ||
| + | authoritative; | ||
| + | |||
| + | subnet 10.108.108.0 netmask 255.255.255.0 { | ||
| + | range dynamic-bootp 10.108.108.151 10.108.108.200; | ||
| + | option broadcast-address 10.108.108.255; | ||
| + | option routers 10.108.108.254; | ||
| + | option local-proxy-config " | ||
| + | } | ||
| + | |||
| + | host admin1 { | ||
| + | hardware ethernet 00: | ||
| + | fixed-address 10.108.108.151; | ||
| + | } | ||
| + | </ | ||
| + | systemctl start dhcpd | ||
| + | systemctl enable dhcpd | ||
| =====Squid===== | =====Squid===== | ||
| ====Installation==== | ====Installation==== | ||
| Line 71: | Line 195: | ||
| . | . | ||
| visible_hostname gateway.lz.local | visible_hostname gateway.lz.local | ||
| - | http_port 3128 | + | http_port |
| . | . | ||
| #enable only (adapt to zorgnet subnet) | #enable only (adapt to zorgnet subnet) | ||
| - | acl localnet src 10.0.0.0/24 # RFC1918 possible internal network | + | acl localnet src 10.108.108.0/24 # RFC1918 possible internal network |
| . | . | ||
| #enable 1024MB cache-size | #enable 1024MB cache-size | ||
| cache_dir ufs / | cache_dir ufs / | ||
| + | . | ||
| + | # Diable IPv6 | ||
| + | dns_v4_first on | ||
| . | . | ||
| </ | </ | ||
| Line 85: | Line 212: | ||
| On the Windows client set the proxy server as the Administrator user in IE. After that run command-box with the following command: | On the Windows client set the proxy server as the Administrator user in IE. After that run command-box with the following command: | ||
| netsh winhttp import proxy source=ie | netsh winhttp import proxy source=ie | ||
| + | |||
| + | Or use a proxy.pac file: | ||
| + | <code - / | ||
| + | function FindProxyForURL(url, | ||
| + | |||
| + | // If the requested website is hosted within the internal network, send direct. | ||
| + | if (isPlainHostName(host) || | ||
| + | shExpMatch(host, | ||
| + | shExpMatch(host, | ||
| + | shExpMatch(host, | ||
| + | return " | ||
| + | else | ||
| + | return "PROXY 10.108.108.5: | ||
| + | } | ||
| + | </ | ||
| + | cd / | ||
| + | ln -s proxy.pac wpad.dat | ||
| + | |||
| =====Guacamole===== | =====Guacamole===== | ||
| This is the HTML5 RDP/SSH/VNC gateway application using Tomcat and Apache as reverse-proxy. | This is the HTML5 RDP/SSH/VNC gateway application using Tomcat and Apache as reverse-proxy. | ||
| Line 103: | Line 248: | ||
| password=" | password=" | ||
| encoding=" | encoding=" | ||
| - | < | + | < |
| < | < | ||
| - | <param name=" | + | <param name=" |
| </ | </ | ||
| < | < | ||
| < | < | ||
| - | <param name=" | + | <param name=" |
| </ | </ | ||
| </ | </ | ||
| Line 126: | Line 271: | ||
| setsebool -P httpd_can_network_connect 1 | setsebool -P httpd_can_network_connect 1 | ||
| ====Configuration==== | ====Configuration==== | ||
| - | <code - / | + | <code - / |
| < | < | ||
| ServerAdmin webmaster@helux.nl | ServerAdmin webmaster@helux.nl | ||
| - | | + | |
| - | RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L] | + | AllowOverride All |
| + | Options MultiViews FollowSymlinks SymLinksIfOwnerMatch IncludesNoExec | ||
| + | Options -Indexes | ||
| + | Order allow,deny | ||
| + | Allow from all | ||
| + | </ | ||
| - | | + | |
| - | | + | AddType application/x-ns-proxy-autoconfig pac |
| - | </VirtualHost> | + | |
| + | <Files " | ||
| + | AddType application/x-ns-proxy-autoconfig dat | ||
| + | </Files> | ||
| + | ErrorLog / | ||
| + | CustomLog / | ||
| + | </ | ||
| + | </ | ||
| + | <code - / | ||
| < | < | ||
| ServerAdmin webmaster@helux.nl | ServerAdmin webmaster@helux.nl | ||
| Line 182: | Line 340: | ||
| yum install chrony | yum install chrony | ||
| ====Configuration==== | ====Configuration==== | ||
| - | <code - /etc/chronyd.conf> | + | <code - /etc/chrony.conf> |
| # Allow NTP client access from local network. | # Allow NTP client access from local network. | ||
| #allow 192.168/16 | #allow 192.168/16 | ||
| - | allow 10.0.0.0/8 | + | allow 10.108.108.0/24 |
| # Listen for commands only on localhost. | # Listen for commands only on localhost. | ||
| Line 221: | Line 379: | ||
| | | ||
| ====Create new zones==== | ====Create new zones==== | ||
| - | firewall-cmd --permanent --new-zone=local | ||
| firewall-cmd --permanent --new-zone=zorgnet | firewall-cmd --permanent --new-zone=zorgnet | ||
| Line 229: | Line 386: | ||
| firewall-cmd --permanent --zone=public --add-source=::/ | firewall-cmd --permanent --zone=public --add-source=::/ | ||
| - | | + | firewall-cmd --permanent --zone=zorgnet --add-source=10.108.108.0/24 |
| - | + | ||
| - | | + | |
| ====Create additional services==== | ====Create additional services==== | ||
| Line 246: | Line 401: | ||
| firewall-cmd --permanent --zone=public --add-service=http | firewall-cmd --permanent --zone=public --add-service=http | ||
| firewall-cmd --permanent --zone=public --add-service=https | firewall-cmd --permanent --zone=public --add-service=https | ||
| - | + | | |
| - | | + | |
| - | firewall-cmd --permanent --zone=local --add-service=http | + | |
| - | firewall-cmd --permanent --zone=local --add-service=https | + | |
| firewall-cmd --permanent --zone=zorgnet --add-service=ssh | firewall-cmd --permanent --zone=zorgnet --add-service=ssh | ||
| Line 257: | Line 409: | ||
| firewall-cmd --permanent --zone=zorgnet --add-service=dns | firewall-cmd --permanent --zone=zorgnet --add-service=dns | ||
| firewall-cmd --permanent --zone=zorgnet --add-service=squid | firewall-cmd --permanent --zone=zorgnet --add-service=squid | ||
| + | firewall-cmd --permanent --zone=zorgnet --add-service=dhcp | ||
| ====Set default zone==== | ====Set default zone==== | ||
| - | firewall-cmd --set-default-zone=local | + | firewall-cmd --set-default-zone=public |
| systemctl enable firewalld | systemctl enable firewalld | ||
| - | systemctl disable kdump | ||
| + | =====Fail2ban===== | ||
| + | yum install -y fail2ban fail2ban-systemd | ||
| + | yum update -y selinux-policy* | ||
| + | Configure fail2ban, we decide to use FirewallD which is implemented by default in CentOS 7. | ||
| + | Put the following lines in / | ||
| + | <code - / | ||
| + | [sshd] | ||
| + | enabled = true | ||
| + | port = ssh | ||
| + | logpath = %(sshd_log)s | ||
| + | maxretry = 5 | ||
| + | bantime = 86400 | ||
| + | </ | ||
| + | |||
| + | systemctl enable fail2ban | ||
| + | systemctl start fail2ban | ||
| {{tag> | {{tag> | ||