Date: Wed, 28 Nov 2001 14:09:19 +0200 From: Ruslan Ermilov <ru@FreeBSD.org> To: Vlad Skvortsov <vss@smarts-gsm.ru> Cc: questions@FreeBSD.org Subject: Re: route add <host> -interface Message-ID: <20011128140919.A42977@sunbay.com> In-Reply-To: <20011128143913.M11977@smarts-gsm.ru> References: <20011128143913.M11977@smarts-gsm.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 28, 2001 at 02:39:13PM +0300, Vlad Skvortsov wrote: > Hello ! > > [Please CC: any answers back to me, I'm not on the list !] > > I'm trying to set up a connection with our peer using sbni adapter > (http://www.granch.ru). The specific of the situation is that ISP routes a > block of 4 ip addresses to our router via modem line and I have to forward > one of these addresses to peer. > > ISP cisco > ========== =========================== > 1.2.3.4 | -- modem --> | 1.2.3.5 | | 192.168.1.1 | -- ethernet --> > ========== =========================== > > Internal router Peer > =============================== =========== > ----> | 192.168.1.2 | | 192.168.2.1 | -- sbni -> | 2.3.4.1 | > =============================== =========== > > ISP forwards a block of addresses, say, 2.3.4.0/30 to 1.2.3.5. Cisco > router forwards them to some internal servers. My task is to forward one > address, 2.3.4.1, to peer. > > The problem is that I cannot setup internal router to properly > forward this address to peer. Peer cannot set 192.168.2.x address on his end > of sbni interface (windows there ...). So I configure my end this way: > > # ifconfig sbni1 192.168.2.1 netmask 0xffffffff > # route add 2.3.4.1 -interface sbni1 > > Pinging 2.3.4.1 fails with redirect FROM MY END 192.168.2.1 > (redirected to 2.3.4.1). When I start exploring the situation, it reveals > that ARP table contains record with MY MAC address and IP of PEER. When I > see netstat -nr output I discover that there is an entry containing PEER's > ip address and MY ip address (though with proper interface specified). > > Is this a bug in sbni driver or is this a misbehaviour of freebsd > route add command ? I run FreeBSD 4.2. > So, your purpose is to resolve the 2.3.4.1 address through the ARP on the sbni1 attached ethernet-type network, right? You can do this in two ways. 1. The standard way. Configure your sbni1 interface with netmask other than 255.255.255.255 and give the peer an address in the 192.168.2 network, say 192.168.2.2. Then, the following command will DTRT: route add -host 2.3.4.1 192.168.2.2 2. A magnician's way. Bring your sbni1 interface up, without even configuring any IP address on it! Then the following command should DTRT: route add -net 2.3.4.1/32 -iface sbni1 -cloning This tells your kernel that it should resolve 2.3.4.1/32 addresses through the ARP on the sbni1 attached network. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011128140919.A42977>