How To Add New Route In Ubuntu, Linux?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/add-new-route-ubuntu-linux/
PINTEREST
PINTEREST
INSTAGRAM

I have a box with Ubuntu Linux and I want to add new route to my box. Because I want to access external network from a different interface and network. How can I add new route to my Ubuntu, Debian, Fedora, CentOS Linux box? Because ip-tools is the same for all of this linux distributions.

Display Existing Routing Table

First we should display existing routing table. Our target network should not intersect existing routing information.

Add New Route

We will add new route to the 172.16.0.0/16 network.

  • ip route add  is our command to add new route
  • 172.16.0.0/24 is target network which is destination range
  • via 192.168.122.1 specifies the next hoop which should be directly connected to our system network.
  • dev ens3 specifies our interface which is same network with 192.168.122.1

Check New Route

This is a route action but we should check the status of the route

Ok goof there is no problem. We can make ping or traceroute test too.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/add-new-route-ubuntu-linux/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  How To Set Permission For Folders and Subfolders in Linux

Leave a Reply

Your email address will not be published.