From owner-freebsd-questions@FreeBSD.ORG Sat Oct 15 08:21:13 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 111F316A41F for ; Sat, 15 Oct 2005 08:21:13 +0000 (GMT) (envelope-from infofarmer@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7983443D66 for ; Sat, 15 Oct 2005 08:21:03 +0000 (GMT) (envelope-from infofarmer@gmail.com) Received: by zproxy.gmail.com with SMTP id 8so590558nzo for ; Sat, 15 Oct 2005 01:21:03 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=t3IxMaaKtZ7wQqjnjBey0AXVZBu6uWrx33JzjLnEfxSaRmLdSeNaQwGMO6W05TvtwjAAmM9ZsrQoU6vhZf7EWjoBKkGj3hH+j4zsaY+tRZnLxF9WXLuX+K/cLfl55zeVDj+8Fg10lHwdbmk3Xk+3s5fneXqVy82Ywc7vkhg2Jek= Received: by 10.37.15.41 with SMTP id s41mr531791nzi; Sat, 15 Oct 2005 01:21:03 -0700 (PDT) Received: by 10.37.20.34 with HTTP; Sat, 15 Oct 2005 01:21:03 -0700 (PDT) Message-ID: Date: Sat, 15 Oct 2005 12:21:03 +0400 From: "Andrew P." To: Bob Hepple In-Reply-To: <20051015092747.008bf142.bhepple@freeshell.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20051015092747.008bf142.bhepple@freeshell.org> Cc: freebsd-questions@freebsd.org Subject: Re: FreeBSD routing X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2005 08:21:13 -0000 On 10/15/05, Bob Hepple wrote: > Hello! > > I'm new to FreeBSD (5.3) and trying to make the transition from Linux. On= e > thing that has me stumped is a routing question... it must be something > really simple because I can do it all the time in Linux. > > I just want to add an arbitrary machine (eg. with IP 192.168.2.214) to my > home network 192.168.254.0/24. Under Linux I just do a > > route add -host 192.168.2.214 eth0 > > and I can ping it. > > On FreeBSD I tried both > > route add -host 192.168.2.214 192.168.254.245 > route add -host 192.168.2.214 -interface rl0 > > but I'm getting some kind of redirect loop. Apparently my use of the > FreeBSD route command is wrong. > > BTW - I don't want to use DHCP for various reasons (mainly because I need > to ssh to the new machine and therefore need to have a known IP address - > but also because some of the machines I need to add don't support DHCP > clients or else setting them up to do so is just too much). > > I haven't got round to natd and firewalling stuff yet and I won't try > turning these on until I can at least ping the new box. For now, these > features are not enabled in /etc/rc.conf. > > Just to eliminate the obvious - yes I booted Linux on this machine > and tested it and it worked - so it's not a h/w problem. > > Here's the detail: I'm issuing the "route add" commands on "raita" and > trying to reach "rasam": > > internet > | > router > .192.168.0.1 > . > . wireless > . > .ath0/192.168.0.18 > raita > |rl0/192.168.254.245 > | > -------------------------- 10baseT > | > | > |192.168.2.214 > rasam > > bash-2.05b# ifconfig -a > rl0: flags=3D8843 mtu 1500 > options=3D8 > inet 192.168.254.245 netmask 0xffffff00 broadcast 192.168.254.255 > inet6 fe80::201:29ff:fe74:99c2%rl0 prefixlen 64 scopeid 0x1 > ether 00:01:29:74:99:c2 > media: Ethernet autoselect (none) > status: no carrier > ath0: flags=3D8843 mtu 1500 > inet 192.168.0.18 netmask 0xffffff00 broadcast 192.168.0.255 > inet6 fe80::209:5bff:fee8:b9d2%ath0 prefixlen 64 scopeid 0x3 > ether 00:09:5b:e8:b9:d2 > media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps) > status: associated > ssid Baroona 1:Baroona > channel 6 authmode OPEN powersavemode OFF powersavesleep 100 > rtsthreshold 2312 protmode CTS > wepmode MIXED weptxkey 1 > wepkey 1:40-bit > > I tried two ways to add the route to rasam from raita: > > 1/ using the address for the interface: > > # netstat -rn > Routing tables > > Internet: > Destination Gateway Flags Refs Use Netif Expir= e > default 192.168.0.1 UGS 0 24 ath0 > 127.0.0.1 127.0.0.1 UH 0 139 lo0 > 192.168.0 link#3 UC 0 0 ath0 > 192.168.0.1 link#3 UHLW 1 22 ath0 > 192.168.254 link#1 UC 0 0 rl0 > > bash-2.05b# route add -host 192.168.2.214 192.168.254.245 > add host 192.168.2.214: gateway 192.168.254.245 > bash-2.05b# netstat -rn > Routing tables > > Internet: > Destination Gateway Flags Refs Use Netif Expir= e > default 192.168.0.1 UGS 0 700 ath0 > 127.0.0.1 127.0.0.1 UH 0 139 lo0 > 192.168.0 link#3 UC 0 0 ath0 > 192.168.0.1 00:09:5b:ec:45:4a UHLW 1 44 ath0 54= 7 > 192.168.2.214 192.168.254.245 UGHS 0 448 rl0 > 192.168.254 link#1 UC 0 0 rl0 > 192.168.254.245 00:01:29:74:99:c2 UHLW 1 448 lo0 > > bash-2.05b# ping rasam > PING rasam.gc.eracom-tech.com (192.168.2.214): 56 data bytes > 36 bytes from raita.finder.com.au (192.168.254.245): Redirect Host(New ad= dr: 192.168.254.245) > Vr HL TOS Len ID Flg off TTL Pro cks Src Dst > 4 5 00 0054 00ba 0 0000 40 01 f6d2 192.168.254.245 192.168.2.214 > ... > > 2/ By using the interface name: > > bash-2.05b# netstat -rn > Routing tables > > Internet: > Destination Gateway Flags Refs Use Netif Expir= e > default 192.168.0.1 UGS 0 708 ath0 > 127.0.0.1 127.0.0.1 UH 0 139 lo0 > 192.168.0 link#3 UC 0 0 ath0 > 192.168.0.1 00:09:5b:ec:45:4a UHLW 1 44 ath0 31= 5 > 192.168.254 link#1 UC 0 0 rl0 > 192.168.254.245 00:01:29:74:99:c2 UHLW 0 448 lo0 > > bash-2.05b# route add -host 192.168.2.214 -interface rl0 > add host 192.168.2.214: gateway rl0 > bash-2.05b# netstat -rn > Routing tables > > Internet: > Destination Gateway Flags Refs Use Netif Expir= e > default 192.168.0.1 UGS 0 708 ath0 > 127.0.0.1 127.0.0.1 UH 0 139 lo0 > 192.168.0 link#3 UC 0 0 ath0 > 192.168.0.1 00:09:5b:ec:45:4a UHLW 1 44 ath0 28= 6 > 192.168.2.214 00:01:29:74:99:c2 UHLS 0 0 rl0 > 192.168.254 link#1 UC 0 0 rl0 > 192.168.254.245 00:01:29:74:99:c2 UHLW 0 448 lo0 > > bash-2.05b# ping rasam > PING rasam.gc.eracom-tech.com (192.168.2.214): 56 data bytes > 36 bytes from raita.finder.com.au (192.168.254.245): Redirect Host(New ad= dr: 192 > .168.2.214) > Vr HL TOS Len ID Flg off TTL Pro cks Src Dst > 4 5 00 0054 063f 0 0000 40 01 f14d 192.168.254.245 192.168.2.214 > > 36 bytes from raita.finder.com.au (192.168.254.245): Redirect Host(New ad= dr: 192 > .168.2.214) > Vr HL TOS Len ID Flg off TTL Pro cks Src Dst > 4 5 00 0054 063f 0 0000 3f 01 f24d 192.168.254.245 192.168.2.214 > > ... same story. Any idea what I'm doing wrong? > > > Thanks > > > > Bob > > -- > Bob Hepple, Research & Development Group > Eracom Technologies Australia Pty. Ltd. > 28 Greg Chappell Drive, Burleigh Heads, Qld. 4220, Australia > Tel.: +61 7 5593 4911 Fax.: +61 7 5593 4388 > mailto:bob.hepple@eracom-tech.com http://www.eracom-tech.com > Public Key: http://bhepple.freeshell.org/public_keys.txt > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" > > I haven't tried this setup, and I'm too lazy to try it now, but I would start with setting gateway_enable in /etc/rc.conf, adding device bpf to kernel and if that doesn't help, I'd try to add a static arp entry (arp -s remote-IP remote-MAC). Then of course, adding a 192.168.2.x/24 alias to the interface would be a better (straighter) solution, but I'd certainly like to find out how to do it properly your way.