Related Items  

Linux and Windows IT Support  


Windows, Apple and Linux IT support and services.

For Software and Web Development.

Add static route with destination


linux 128Q. I have 5 IP addresses from my provider, however, I can only access 1. When I try to access the others internally, they time out.

Another scenario: I would like to access a different subnet. (eg from How can this be done?

A. You need to add the gateway for particular IPs (or IP range) manually, to the routing table. (This exercise assumes that you are running a linux based router).

route -n

Will produce something like this:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface          UG    100    0        0 eth0 U     0      0        0 eth0     U     0      0        0 vnet0

Assuming you have another IP address you would like to route through, here's what to do:

route add -net netmask gw

This will produce the following route -n output:

Kernel IP routing table
Destination           Gateway                Genmask             Flags     Metric Ref Use Iface                        UG         100 0 0 eth0            U           0 0 0 eth0                  U           0 0 0 vnet0 UGH     0 0 0 eth0

 If you want to route an entire subnet (eg:, not just one IP address, you can do the following:

route add -net netmask gw


Comments (1)
Route add
1 Thursday, 23 February 2017 04:57
Aslam Khan
Good solutions

Add your comment

Your name:
  The word for verification. Lowercase letters only with no spaces.
Word verification:
yvComment v.1.24.0
Copyright © 1999 - 2022 Virtual Helpme | Techical Support and Maintenance | Original Template: Allrounder