In order to make the configurations permanent, add these lines to /etc/rc.d/rc.local , so that they are executed each time that the server is rebooted:
bash# vi /etc/rc.d/rc.local ### configure network interfaces /usr/local/config/network-setup ### CACHE port forwarding /usr/local/config/port-forward ### source NAT (masquerading) /usr/local/config/source-nat on ### start the CSP service cd /cachesys/csp/ ./CSPnsd
For updating the configuration of the server without rebooting (e.g. when something is modified in the configuration files), the script /usr/local/config/reconfig is used:
bash# vi /usr/local/config/reconfig #!/bin/sh ### reconfig the network after changing the network-setup ### configure network interfaces /usr/local/config/network-setup ### restarting iptables will flush all the rules ### (also the rules about forwarding and SNAT) /sbin/service iptables restart ### CACHE port forwarding /usr/local/config/port-forward ### source NAT (masquerading) /usr/local/config/source-nat on ### restart cache cd /cachesys/csp/ ./CSPnsd stop ./CSPnsd
Copy /usr/local/config/network-config-1 or /usr/local/config/network-config-2 to /usr/local/config/network-config , in order to enable this configuration and disable the other.
In case that the port forwarded to CACHE needs to be changed, change it at the /usr/local/config/port-forward script and to /etc/sysconfig/iptables .
Also, if the CACHE_IP changes, change it at /cachesys/csp/CSP.ini as well.
Run the script /usr/local/config/reconfig in order to change the network configuration immediately, or reboot.