Modify

Opened 4 years ago

Last modified 4 years ago

#16664 new defect

dhcp client does not add default route from other subnet

Reported by: basinilya Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

Here's an example of my ISP's dhcp parameters:

router=92.100.0.1
subnet=255.255.255.0
interface=eth0.2
dns=212.48.193.38 212.48.193.37
serverid=192.168.1.1
ip=178.71.29.26
lease=30
mask=24
opt53=05

default route not added on openwrt, because it's not in my subnet.
Workaround:

root@OpenWrt:~# cat /etc/udhcpc.user
case "$1" in
    renew|bound)
        for r in $router ; do

route add -host $r dev $interface 2>/dev/null
route add -net 0.0.0.0 netmask 0.0.0.0 gw $r 2>/dev/null

        done
        ;;
esac

BARRIER BREAKER (Bleeding Edge, r40887)

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by jch@…

A better solution would be

ip route add default via $r dev $interface onlink

The "onlink" flag does exactly what you need -- it asserts that the nexthop is directly attached and disables checking of the attached prefix.

I reckon this should be safe to do by default.

--jch

comment:2 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.