Opened 12 years ago

Closed 12 years ago

Last modified 6 years ago

#484 closed defect (fixed)

Static route without gateway IP does not work

Reported by: vlabakje@… Owned by: florian
Priority: normal Milestone: 0.9/rc6
Component: base system Version:
Keywords: static route Cc:


For my internet setup (SIP spoofing ADSL with an Alcatel modem). I need to add these routes:

host using interface vlan1 (no gateway) normal command:

route add host dev vlan1

default gateway at normal command:

route add default gw

When added to the static_route nvram setting, as proposed in your Wiki, i use the following setting:


This results in the following error messages during boot:

route: SIOC[ADD|DEL]RT: Invalid argument

In fact the only problem is in line 11 of /etc/init.d/S40network which executes the following line:

route add -net netmask gw metric 0 dev vlan1

manually altering this command to:

route add -net netmask metric 0 dev vlan1

My proposed solution:

Altering the network script to detect a value of "null" or in the "gateway" field, resulting in a command without this field.

I am prepared to help in any way with this problem, however I am new to the OpenWRT package since a few days, if altering the S40network script is a possibility, I volunteer to do and test this.

Attachments (0)

Change History (5)

comment:1 Changed 12 years ago by florian

  • Owner changed from developers to florian
  • Status changed from new to assigned

Could you have a try at the new static_routes management introduced in changesets [3629] and [3628] ?

comment:2 Changed 12 years ago by vlabakje@…

I took a peek at it. It looks like the solution to this problem, i just don't know how a change in /etc/ is going to fix this, seen as the routes are added in /etc/initd./, and that hasn't been changed in SVN yet.

comment:3 Changed 12 years ago by anonymous

Routes, are now added by the ifup script (which calls do_ifup in /etc/ called in /etc/init.d/S40network

comment:4 Changed 12 years ago by kaloz

  • Milestone set to 1.0-rc6

comment:5 Changed 12 years ago by florian

  • Resolution set to fixed
  • Status changed from assigned to closed

Old behaviour (as described in the wiki, with metric and gateway) is now restored, and we keep, per interface static routes.

Usage: nvram set lan_static_route="<network>:<mask>:<gateway>:<metric>"

Fixed in [3809]

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.