Im trying to configure a GRE over IPSec connection between two subnets. The IPSec tunnel is opened and now I want to add a GRE tunnel over it:

ip tunnel add GRE01 mode gre remote local ttl 255
ip link set GRE01 up
ip addr add dev GRE01
ip route add dev GRE01

Now I have an interface GRE01 (ifconfig):

GRE10     Link encap:UNSPEC  HWaddr <h_addr>
inet addr:  P-t-P:  Mask:
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

And the following routes (ip route list): dev GRE10  scope link 
<pub_subnet> dev eth0  proto kernel  scope link  src <pub_ip> 
default via <pub_gw> dev eth0  metric 100

As a last step, I need now to route my subnet over the tunnel:

ip route add

However, I am getting the error

Error: either "to" is duplicate, or "" is a garbage.

So, what I didn't understand is why I can't route my subnet over the tunnel, once the only route I have there says that it should route the tunnel IP over the GRE01 interface. Any hint? Thanks.

1 Answer 1


You are missing the word via in your route command

ip route add via
  • duh, I thought that duplicate was about entries in the route table, by the way, there is no "via" in my reference book. Thanks.
    – eMgz
    Mar 1, 2011 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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