Add Route Linux

In this tutorial you are going to show how to configure Linux System to reach different networks from different routes.
In our scenario we are going to configure a Linux server to reach network 253.0.0.0/8 from gateway 10.0.0.253. The command used is
route add -net 253.0.0.0/8 gw 10.0.0.253

Then we are going to configure the server to reach network 254.0.0.0/8 from gateway 10.0.0.254. The command used is
route add -net 254.0.0.0/8 gw 10.0.0.254

To configure a default gateway for any other destinations you can use the command:
route add default gw 10.0.0.1
(Your gateway or router IP: 10.0.0.1)

To save these commands or to run when your system starts up, add the above command to the file /etc/rc.local

To show the routing table in Linux just issue the command “route”

Thanks for watching and reading
If that helped you, please Like, Subscribe and share it

Nguồn: https://codeigniterbrasil.com

Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-linux/

Leave a Reply