Modify

Opened 11 years ago

Closed 11 years ago

Last modified 4 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:

Description

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

host 192.168.10.1 using interface vlan1 (no gateway) normal command:

route add host 192.168.10.1 dev vlan1

default gateway at 192.168.10.1 normal command:

route add default gw 192.168.10.1

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

static_route=192.168.10.1:255.255.255.255:0.0.0.0:0:vlan1 0.0.0.0:0.0.0.0:192.168.10.1:0:vlan1

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 192.168.10.1 netmask 255.255.255.255 gw 0.0.0.0 metric 0 dev vlan1

manually altering this command to:

route add -net 192.168.10.1 netmask 255.255.255.255 metric 0 dev vlan1

My proposed solution:

Altering the network script to detect a value of "null" or 0.0.0.0 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 11 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 11 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/functions.sh is going to fix this, seen as the routes are added in /etc/initd./S40network.sh, and that hasn't been changed in SVN yet.

comment:3 Changed 11 years ago by anonymous

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

comment:4 Changed 11 years ago by kaloz

  • Milestone set to 1.0-rc6

comment:5 Changed 11 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

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


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

 
Note: See TracTickets for help on using tickets.