Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure soft routing in linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Many novices are not very clear about how to configure soft routing in linux. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.

Lab name: soft routing under Linux host

Lab description: this lab does not require the installation of task software packages. Linux comes with it!

Lab topology: the ip address plan is shown in the figure:

Experimental environment: it doesn't matter whether the test machine is windows or Linux, just make sure that the machine that acts as the routing function is Linux!

The purpose of the experiment is to enable this machine of ip 192.168.1.121 and ip 10.0.0.100 to communicate with each other in Linux environment.

The steps of the experiment:

Based on the simplicity of this lab, it takes only one command for the Linux host to support the routing function, that is

Echo 1 > / proc/sys/net/ipv4/ip_forward, that is, import the number 1 into the ip_forward file of / proc/sys/net/ipv4/ip_forward.

Or # echo "1" > / proc/sys/net/ipv4/ip_forward

View:

So we can test it directly.

The network card configuration parameters of each machine will not be mentioned here!

Let's take a look at the test results directly!

This is the case with ip 192.168.1.121 ping ip 10.0.0.100; let's take a look at the reverse:

The above is a very simple example: if there is only one Linux host acting as the router, if there are multiple Linux hosts acting as the router, then we must turn on the routing function of the Linux host. In addition, a static default route must be configured to realize the communication between multiple network segments.

The following is the implemented command:

Echo 1 > / proc/sys/net/ipv4/ip_forward

Add static default rout

Route add-net segment subnet mask next hop > / etc/rc.d/rc.local

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report