#20211: dhcp + static IP: bad routing table when using metric
-------------------------+----------------------------------
Reporter: skcris | Owner: developers
Type: defect | Status: new
Priority: normal | Milestone: Chaos Calmer (trunk)
Component: base system | Version: Trunk
Keywords: |
-------------------------+----------------------------------
When using this configuration
{{{
config interface 'wan'
option ifname 'eth1'
option proto 'dhcp'
option metric 3
config interface 'lan'
option ifname 'eth1'
option proto 'static'
option ipaddr '10.98.11.62'
option netmask '255.255.255.0'
}}}
I get this route entry
192.168.1.0/24 dev eth1 proto static scope link metric 3
If I remove the "metric" option, it's
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
Since the static IP happens to be the first IP for the eth1 interface, it
results in this when using the "metric" option
# ip route get 192.168.1.103
192.168.1.103 dev eth1 src 10.98.11.62
Instead of this, which is the correct one
# ip route get 192.168.1.103
192.168.1.103 dev eth1 src 192.168.1.1
Given that an interface can have multiple addresses, the routing entry
created when using the metric option should also contain the src address.
I'm using commit a9be6c0348ce622a3d3806804b1c372fdb11db25, from the Chaos
Calmer branch.
--
Ticket URL: <https://dev.openwrt.org/ticket/20211>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets