Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an IP address in my linux box that is eth0:1. Alias of eth0. I want to create a route from that IP to an external IP in another box.

How can I do it? Do I need netmask and gateway?

share|improve this question
Please explain in more detail what it is you want to achieve by this. – wolfgangsz Jun 22 '11 at 15:17
I want to create a route between two IP addresses and set a discrete MTU value for that route. – cateof Jun 22 '11 at 15:21
up vote 0 down vote accepted

Routes in IP networking are always target oriented. There is an option to do source routing, but it is hardly ever used nowadays.

Simply define a new static route (using the route add -net command), and define the metric for that route. The problem now is that unless your linux box is a router for (i.e. all traffic for must pass through this linux box), then traffic will simply go directly there, and your route won't have any effect. In order to make sure your traffic does go through, you must then set up a route on your source machine that makes the router. You can do this with

route add -host gw mss <size>
share|improve this answer
the box is not a router for So I guess that I need to use route add -net gw mss 1500 (please note -net and not -host) – cateof Jun 22 '11 at 19:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.