On Thu, Feb 26, 2015 at 1:26 AM, Walter Dnes <waltd...@waltdnes.org> wrote: > > I've been Googling and playing around a bit. I have the main ADSL > connection to the world working via iproute2, but not the 169.254.0.0/16 > net. I can't figure out what I'm doing wrong. My setup... > > * desktop PC 192.168.123.251/29, with NIC interface eth0 > * HDHomerun network TV tuner in 169.254.0.0/16 > > Both are attached to an ADSL router at 192.168.123.254 I start off > with "/etc/init.d/net.eth0 stop" to get to a known state. Then I run a > script which issues the commands... > > ip link set eth0 down > ip link set eth0 up > ip address add 192.168.123.251/29 dev eth0 > ip route add default via 192.168.123.254 metric 100 > ip address add 169.254.1.1/16 dev eth0 > ip route add 169.254.0.0/16 via 192.168.123.254 metric 0 > ip address show > ip route show > > The output from the commands is... > > RTNETLINK answers: File exists > RTNETLINK answers: File exists
These two errors are due to the fact that "ip l set down dev eth0" doesn't delete assigned ip addresses, only assigned routes. So when you run "ip a add ...", you're setting addresses that are already set. > RTNETLINK answers: File exists This error is due to the fact that "ip a add 168.254.1.1/16 dev eth0" includes an automatic "ip r add 169.254.0.0/16 src 169.254.1.1 proto kernel scope link dev eth0" so there's already a route for "169.254.0.0/16". You could run "ip r del 168.254.0.0/16 dev eth0" and then "ip r add 169.254.0.0/16 via 192.168.123.254". > 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group > default > link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 > inet 127.0.0.1/8 brd 127.255.255.255 scope host lo > valid_lft forever preferred_lft forever > 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state > DOWN group default qlen 1000 > link/ether 00:1d:09:96:6c:1c brd ff:ff:ff:ff:ff:ff > inet 192.168.123.251/29 scope global eth0 > valid_lft forever preferred_lft forever > inet 169.254.1.1/16 scope global eth0 > valid_lft forever preferred_lft forever > default via 192.168.123.254 dev eth0 metric 100 > 127.0.0.0/8 dev lo scope host > 169.254.0.0/16 dev eth0 proto kernel scope link src 169.254.1.1 > 192.168.123.248/29 dev eth0 proto kernel scope link src 192.168.123.251 > > Like I said above, the default route to the world works, but not to > 169.254.0.0. Once I get that figured out, the next questions are... > 1) What is the setup in /etc/conf.d/net to accomplish that? You'd originally had routes_eth0=" default via 192.168.123.254 metric 20 192.168.123.248/29 via 192.168.123.254 metric 0 169.254.0.0/16 via 169.254.1.1 metric 0" so you'd have to change the last line. > 2) Should iproute2 be built with or without the "iptables" flag? There may be other use cases but the only one that I can think of is that this flag allows you to use "iptables ... -j MARK --set-mark walt" and then "ip ru add ... fwmark walt ...".