Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Im having troubles with my routing table, im getting RTNETLINK answers: file exist

How do i set my default gateway (internet) to and a static route going to /26?

i have 2 GW as shown in flags, how do i remove the G on my route line # 2?

Destination    Gateway          Genmask         Flags    Metric    Ref   Use    Iface         UG       100      0      0      eth0    UG        0       0      0      eth1      U         0       0      0      eth2
share|improve this question
Why do you need to remove the G? The G means gateway, it doesn't mean that it's a default route. The G has to be there if you are adding a route for the network, because the packets will go through a "gateway". The Destination is what denotes that it's a default route, which is your first line. So your routing table is currently configured correctly according to your question: How do I set my default gateway (internet) to and a static route going to /26? When and where do you get the error RTNETLINK answers: file exist? – Alaa Ali Jun 3 '13 at 13:56 is a gateway to other network as well, it conflicts with my how can i tell the system to route everything to when dealing with destinations? – user1645034 Jun 3 '13 at 14:08
i managed to answer my question by issuing this command: route add -net netmask gw – user1645034 Jun 3 '13 at 14:12
Hmm, that's strange, because the settings in your question should achieve what you wanted in your first comment. The command you issued is now routing all the network to, not just Anyways, you got it fixed! You should answer your own question and accept the answer. – Alaa Ali Jun 3 '13 at 15:01
up vote 1 down vote accepted

for some strange reasons, playing with my routing table, i managed to make it work by issuing this route

route add -net netmask gw

share|improve this answer

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.