Date: Wed, 09 Oct 2002 15:17:37 -0700 From: Andy Sparrow <spadger@best.com> To: thomas@cuivre.fr.eu.org Cc: freebsd-stable@FreeBSD.ORG Subject: Re: Setup routing entry for host with a non-local IP address Message-ID: <20021009221737.0A7AA2A7@CRWdog.demon.co.uk> In-Reply-To: Message from Thomas Quinot <thomas@cuivre.fr.eu.org> of "Wed, 09 Oct 2002 17:17:33 %2B0200." <20021009151733.GA15162@melusine.cuivre.fr.eu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] > Suppose that on a 4.6.2 machine (hostA), I have an interface xl0 > with address 10.10.1.2, netmask 255.255.255.0. > > On that ethernet, I have a host (hostB) that is set up as 10.10.0.1, > netmask 255.255.255.0. I need to send a packet from hostA to hostB, > and to that effect I would like to set up a static route on hostA > indicating that 10.10.0.1 lives on its xl0 interface. This can't work, not as described. > Am I trying to do something impossible, or am I just clueless enough > that I did not find the proper way of cajoling the kernel into > cooperation? Layer 3 routing only cares about networks, not hosts. You need to use a router, as these hosts are in different networks (the fact that they're sharing the same physical network segment notwithstanding). You can use a multi-homed host (e.g. one with a network interface in both networks) that will forward packets. You could add a NIC to one of the hosts and number it so that it is in the "other" network. You could use a "real" router. You could add an alias[0] to either one of the hosts on the shared network segment so that they "understand" that they have two interfaces on the same network and can thus talk to each other. You could also subnet the Class A network you're using with a /16 netmask, so that the 10.10 portion would be the network identifier, and the 1.2 & 0.1 portion of the IP address(es) would be the host identifier - thus, both hosts would be on the same network, and can communicate directly. This will have other implications for your network, however[1] HTH. Rgards, AS [0] From this list, I believe that the alias needs a /32 netmask (e.g. 255.255.255.255) on recent -STABLEs to work correctly. [1] Broadcast address will change, for one. You should probably adjust the netmask on every node on that new network. [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) Comment: Exmh version 2.5 07/13/2001 iD8DBQE9pKsAPHh895bDXeQRAjfsAJ4ydsarDhdhnF+/IYD/UTDFxd3VagCgpRqO 4Mdsgn7Tyt/9+j/YWG83RjY= =DwBR -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021009221737.0A7AA2A7>
