Default gateway - wrong interface. !

Josef Karthauser joe at tao.org.uk
Sun Feb 19 07:14:43 PST 2006


Hey guys,

I'm guessing that this is a bug (or feature!).

I've got a machine with a wlan interface (iwi0), with an ipv4 network
address and a default gateway.  I also have an ethernet card in the same
machine (em0) with the same IP address.  The idea is that I can bring
the wireless down, and the wired interface up to get fast transfers when
approriate, and be wireless the rest of the time.

That works fine, apart from the default gateway:

    # ifconfig iwi0 down
    # ifconfig em0 up
    # arp -ad
    # netstat -rn
    Internet:
    Destination        Gateway            Flags    Refs      Use  Netif
    Expire
    default            87.74.4.33         UGS         0      123   iwi0
    87.74.4.32/27      link#3             UC          0        0    em0
    87.74.4.33         00:90:d0:02:3f:16  UHLW        2        1    em0
    87.74.4.34         00:d0:b7:88:c8:20  UHLW        1  1191414    em0
    127.0.0.1          127.0.0.1          UH          0        2    lo0

Notice, the local subnet is off the em0, but the default route is still
wired off the iwi0.

    # route delete default
    # route add default 87.74.4.33
    # netstat -rn
    Internet:
    Destination        Gateway            Flags    Refs      Use  Netif
    Expire
    default            87.74.4.33         UGS         0      123   iwi0
    87.74.4.32/27      link#3             UC          0        0    em0
    87.74.4.33         00:90:d0:02:3f:16  UHLW        2        1    em0
    87.74.4.34         00:d0:b7:88:c8:20  UHLW        1  1191414    em0
    127.0.0.1          127.0.0.1          UH          0        2    lo0

The default route is _still_ off iwi0; but should be off em0.

There's obviously something dumb doing on here.  Why does the default
route have to be nailed to an interface?  It's clear that 87.74.4.33 is
available from em0 as far as the routing table is concerned.

Joe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20060219/fd4ad6e9/attachment.bin


More information about the freebsd-net mailing list