Modify

Opened 3 years ago

#20211 new defect

dhcp + static IP: bad routing table when using metric

Reported by: skcris Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: base system Version: Trunk
Keywords: Cc:

Description

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.

Attachments (0)

Change History (0)

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.