Configure Linux as a router

  

Because of the configuration of Windows routing and remote access, as well as the ISA server, the router's principle and basic configuration are very familiar, Cisco routers were also configured at the beginning of the year, the configuration of the command line is also I understand that it is relatively simple to configure the router function of Centos.

The first is the configuration of the static router. Before configuring the static route, you must first open the routing and forwarding function of Linux. By default, Linux and Windows are the same. Routing and forwarding of Linux is very simple, you need to modify a parameter. Is to change /proc/sys/net/ipv4/ip_forward to 1, but it can't be used after rebooting. All can be written to /etc/rc.d/rc.local. Another way is to modify /etc/sysctl.conf to also change net.ipv4.ip_forward = 1.

After modifying the forwarding function, you can use the route command and add the route with the add parameter. Setting up a dynamic route requires installing a software called quagga, which provides a service for zebra. Use yum to install and experience the convenience of network installation.

After installation, first set the configuration file /etc/quagga/zebra.conf of the zebra service. Then use init.d to open this service, it will listen to port 2601, we can use telnet to open this 2601 port, there can be a lot of settings and view routing commands, can be used? Or help command to view, I was the first time to contact this management method, use telnet login management, but the process is similar to Cisco's router, easy to get started, the command is similar. Note that when modifying zebra.conf, you must set a password for this port 2601 and make the password take effect. Otherwise, you can't telnet it. You can also view routing information in telnet, using the show ip route command.

There is a specific dynamic routing protocol configuration file under /etc/quagga. If you are testing, you can use the ripd.conf file. You can use /etc/init.d/ripd with a little modification. To start, you can receive the rip data from the surrounding routers.

Copyright © Windows knowledge All Rights Reserved