openwrt route add 指令
To add a route in OpenWrt using the 'route add' command, follow these steps:
1. Access your OpenWrt device either through SSH or by directly connecting to it.
2. Open the terminal or command prompt.
3. Use the following syntax of the 'route add' command to add a specific route:
  ```
  route add -net destination_network/netmask gateway_ip
  ```
  Replace 'destination_network' with the IP address or network you want to route traffic to, and 'netmask' with the subnet mask of the destination network.
  Replace 'gateway_ip' with the IP address of the next hop/gateway to reach the destination
network.
  For example:
  ```
route add命令实例
  route add -net 192.168.2.0/24 192.168.1.1
  ```
4. Press Enter to execute the command.
5. Verify that the route has been added using the 'route -n' command. You should see the newly added route in the output.
Note: The changes made using the 'route add' command are not permanent and will be lost after a device reboot. To make the route persistent, consider adding it to the network configuration files.

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。