Routing settings in linux (using linux as a router)
Source: Internet
Author: User
Route settings in linux (using linux as a router)-Linux Enterprise Application-Linux server application information. For details, refer to the following section. The network structure is as follows:
Pc1 -------------------------------- Linux ------------------------------ pc2
192.168.18.2 ------ 192.168.18.1 --- 192.168.19.1 ------- 192.168.19.2
2. Enable the routing function on linux
Echo "1">/proc/sys/net/ipv4/ip_forward
3. Test whether pc2 can be reached from pc1
Ping 192.168.19.2
4. To prevent the system from automatically disabling the routing function after the restart
Vi/etc/rc. d/rc. local Add the following content.
Echo "1">/proc/sys/net/ipv4/ip_forward
5. This simple linux host router for Static Routing is configured. Note that dynamic routing is generally used if there are too many routes, which is better and more convenient.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service