From owner-freebsd-net Fri Jun 1 12:54:55 2001 Delivered-To: freebsd-net@freebsd.org Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by hub.freebsd.org (Postfix) with ESMTP id 2D84537B422 for ; Fri, 1 Jun 2001 12:54:51 -0700 (PDT) (envelope-from andre.albsmeier@mchp.siemens.de) X-Envelope-Sender-Is: andre.albsmeier@mchp.siemens.de (at relayer david.siemens.de) Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by david.siemens.de (8.11.0/8.11.0) with ESMTP id f51Jso502251 for ; Fri, 1 Jun 2001 21:54:50 +0200 (MET DST) Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7]) by mail3.siemens.de (8.11.1/8.11.1) with ESMTP id f51JsnV10032855 for ; Fri, 1 Jun 2001 21:54:49 +0200 (MEST) Received: (from localhost) by curry.mchp.siemens.de (8.11.3/8.11.3) id f51Jsnu02097; Date: Fri, 1 Jun 2001 21:54:49 +0200 From: Andre Albsmeier To: freebsd-net@FreeBSD.ORG Cc: Andre.Albsmeier@mchp.siemens.de Subject: Routing problem: Is the bug in my brain or in FreeBSD? Message-ID: <20010601215449.A3609@curry.mchp.siemens.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Echelon: BND CIA NSA Mossad KGB MI6 IRA detonator nuclear assault strike Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I don't know where the bug is... Simple network: - two routers (1 and 2) - host C with IP 192.168.1.3 - host S with IP 192.168.2.1 All machines are FreeBSD 4.3-STABLE. Router 1 routes pkts between the Internet and 192.168.1.0 Router 2 routes pkts between 192.168.1.0 and 192.168.2.0 +-----+ +-----+ default | | 192.168.1.0 | | 192.168.2.0 -----------| 1 |--------+--------| 2 |--------+-------- more hosts | | | | | | +-----+ | +-----+ | | | +-----+ +-----+ | | | | 192.168.1.3 | C | | S | 192.168.2.1 | | | | +-----+ +-----+ Relevant parts of netstat -rn on C during normal operation: ------------------------------------------------------------- Destination Gateway Flags Netif Expire default 192.168.1.1 UGSc fxp0 127.0.0.1 127.0.0.1 UH lo0 192.168.1 link#1 UC fxp0 => 192.168.1.1 0:e0:18:90:91:bb UHLW fxp0 1182 192.168.1.2 0:e0:18:90:94:c8 UHLW fxp0 1058 192.168.1.3 0:e0:18:90:45:dc UHLW lo0 192.168.1.255 ff:ff:ff:ff:ff:ff UHLWb fxp0 192.168.2 192.168.1.2 UGc fxp0 The syslogd on host C is configured to log messages to syslogd running on host S. This works perfectly, all messages appear on host S. Now we delete the route to net 192.168.2.0 on host C. When syslogd wants to send another message to S, the kernel uses the default route which is obvious because the route to net 192.168.2.0 is gone. We can see the packets going into router 1. This is OK as well. Now we bring back the route to net 192.168.2.0 again on host C exactly as it was before. We can verify this with netstat -rn on C. We can also ping host S or telnet to it or do other stuff which all work perfectly. The problem is that each time when syslogd on C wants to send a packet to S, the kernel still uses 1 as router even though it should send them through 2. After HUPing or restarting syslogd on C (which means that the UDP socket is closed and opened again) things are back to normal. Is this a know "feature"? It seems that as long as the socket can send the packets somewhere it doesn't bother if there is a better route to the destination until it is closed and opened again. Any hints? -Andre To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message