Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Feb 2006 15:14:35 +0000
From:      Josef Karthauser <joe@tao.org.uk>
To:        net@freebsd.org
Subject:   Default gateway - wrong interface. !
Message-ID:  <20060219151435.GE15477@genius.tao.org.uk>

next in thread | raw e-mail | index | archive | help

--a1QUDc0q7S3U7/Jg
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--a1QUDc0q7S3U7/Jg
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iEYEARECAAYFAkP4i1sACgkQXVIcjOaxUBZ3WwCfZ4w5Q8OUaUxmYxouHWjqfEfj
NrEAoIsQf2gYn9HRq6vogf4K62Biul8V
=VUxB
-----END PGP SIGNATURE-----

--a1QUDc0q7S3U7/Jg--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060219151435.GE15477>