From owner-freebsd-questions Mon Feb 3 08:56:43 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA07715 for questions-outgoing; Mon, 3 Feb 1997 08:56:43 -0800 (PST) Received: from www.chezmoi.com (caliban.chezmoi.com [207.76.149.2]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id IAA07700 for ; Mon, 3 Feb 1997 08:56:40 -0800 (PST) Received: (from csw@localhost) by ftp.chezmoi.com (8.6.12/8.6.12) id AAA02120; Mon, 3 Feb 1997 00:16:02 GMT Date: Mon, 3 Feb 1997 00:16:02 GMT Message-Id: <199702030016.AAA02120@ftp.chezmoi.com> From: chris warth To: freebsd-questions@FreeBSD.ORG Subject: using route -interface Mime-Version: 1.0 (generated by tm-edit 7.89) Content-Type: text/plain; charset=US-ASCII Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Can someone please explain how to use the "-interface" option of the "route" command? How do host routes installed via "-interface" differ from routes learned from using default routes? Specifically, I am running this test on 2.1.0-RELEASE and if I try to use the "-interface" option to force traffic for a particular host out through an interface, I cannot seem to ever get replies back. I understand that this is usually used for ppp interfaces, but why won't it work for simple ethernet interfaces as well? Do I need to do something with proxy-arp? In the simplest case, I have a machine connected to a single local ethernet. Here is the output from "ifconfig -a" de0: flags=8863 mtu 1500 inet 206.26.48.2 netmask 0xffffff00 broadcast 206.26.48.255 lo0: flags=8009 mtu 16384 inet 127.0.0.1 netmask 0xff000000 At the beginning my routing table looks like this: Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 206.26.48.1 UGSc 23 410 de0 127.0.0.1 127.0.0.1 UH 0 7 lo0 206.26.48 link#2 UC 1 0 206.26.48.1 0:c0:7b:0:1f:40 UHLW 12 3 de0 939 206.26.48.2 0:0:c0:96:9d:db UHLW 3 241 lo0 206.26.48.255 link#2 UHLW 1 822 224 link#2 UCS 0 0 206.26.48.1 is my gateway machine. 206.26.48.2 is the machine I am on. If I now delete the route for the gateway machine and replace it with an explicit -interface route, I can no longer communicate with the gateway at all. # route delete 206.26.48.1 delete host 206.26.48.1 # route add 206.26.48.1 -interface 206.26.48.2 add host 206.26.48.1: gateway 206.26.48.2 Now this should be the same as it was before. I have just tried to make explicit what was implied by the subnet mask before, namely, that 206.25.48.1 can be reached via interface de0. Yet now I cannot reach 206.26.48.1! # ping 206.26.48.1 ^C --- 206.26.48.1 ping statistics --- 12 packets transmitted, 0 packets received, 100% packet loss # netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 206.26.48.1 UGSc 17 412 de0 10.100.100 link#3 UC 1 0 127.0.0.1 127.0.0.1 UH 0 7 lo0 206.26.48 link#2 UC 1 0 206.26.48.1 206.26.48.2 UHS 0 12 de0 206.26.48.2 0:0:c0:96:9d:db UHLW 3 281 lo0 206.26.48.255 link#2 UHLW 1 869 224 link#2 UCS 0 0 So I never received any replies to the ping, but the "Use" count for that route did go up as expected. So why do the replies not get back? Again, I am running this test on 2.1.0-RELEASE, but I have also seen the same behavior on 2.1.5-RELEASE. Thanks in advance for any help. -csw