Add a Static Route on CentOS Rumi, May 30, 2019 To add a temporary route: ip route add 172.16.5.0/24 via 10.0.0.101 dev eth0 To make it persist system or network settings restart, create a route-ifname file for an interface through which the subnet is accessed, in this case eth0: nano /etc/sysconfig/network-scripts/route-eth0 Add the line with the network settings for the other subnet: 172.16.5.0/24 via 10.0.0.101 dev eth0 If your computer is on a network and is not directly connected to the internet, it will be configured with what is called a default gateway, which is usually a router. If the computer cannot find the specific IP address on its local network (aka broadcast domain), as defined by its subnet, it will forward any packets headed to that IP address to the default gateway. The gateway will then attempt to forward packets elsewhere, such as the internet, or another broadcast domain. But what if you have a separate network (i.e. another office department) that is NOT accessible via the default gateway? For example, your internet router may be located at 10.0.0.1 and it is serving your local network, 10.0.0.0/8. However, you have a 172.16.5.0 /24 network that is accessible only through a secondary router, which has the IP address 10.0.0.101 on the main network. Therefore, you need to point your OS to the secondary router for any IP addresses located in the 172.16.5.0-255 address space. To do this, you need to add a static route. Add a temporary static route If you wish to add one temporarily, simply run the ip route add command with the right network information: ip route add 172.16.5.0/24 via 10.0.0.101 dev eth0 172.16.5.0 is the network you wish to access. /24 is the subnet mask 10.0.0.101 is the secondary router to which you are adding a default route eth0 is the network interface assigned to your main network (in this case, 10.0.0.0/8) ip route add command will only persist until the next reboot or interface/network settings restart. Add a permanent static route To make the route permament, you need to create a static route configuration file. Create a file with the name route-interface in /etc/sysconfig/network-scripts, such as: nano /etc/sysconfig/network-scripts/route-eth0 Then, add the same line you would with ip route add: 172.16.5.0/24 via 10.0.0.101 dev eth0 Make sure to restart your network settings so they take effect: service network restart If you lose your internet connection If you suddenly cannot connect to the internet after adding a static route and are using static IPs (as opposed to DHCP), you may not have your default gateway configured correctly. Add it to your /etc/sysconfig/network file: nano /etc/sysconfig/network GATEWAY=10.0.0.1 Related Administrations Configurations (Linux) CentOSRoute
Running Zimbra on HTTPS June 11, 2012 1. First you need to su as 'zimbra' user 2. go to /opt/zimbra/bin/ 3. Use the following commands to enable SSL: ./zmtlsctl https ./zmcontrol restart Now it's working like a charm. For other readers: I can only access to webclient by SSL now (but that's ok for me). other options… Read More
Install Varnish Cache On Debian 7 November 6, 2016 Normally Varnish Cache is available on Debian default repositories. But i suggest you to use Varnish Cache repositories to get latest version of Varnish Cache. Run the following commands as root user to install Varnish Cache. # curl http://repo.varnish-cache.org/debian/GPG-key.txt | apt-key add – # echo “deb http://repo.varnish-cache.org/debian/ wheezy varnish-3.0” >>… Read More
Apache Web Server .htaccess File functional February 8, 2013 .htaccess is Apache's directory-level configuration file. It allows end user to configure authentication and other options without editing main httpd.conf file. Make sure AccessFileName set to .htaccess Search httpd.conf for AccessFileName directive. It defines name of the distributed configuration file: # grep -i AccessFileName httpd.conf Make sure users are allowed… Read More