From owner-freebsd-bugs@FreeBSD.ORG Sat May 8 11:30:04 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70A1F1065677 for ; Sat, 8 May 2010 11:30:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 364538FC2D for ; Sat, 8 May 2010 11:30:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o48BU4Rl055206 for ; Sat, 8 May 2010 11:30:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o48BU4LZ055203; Sat, 8 May 2010 11:30:04 GMT (envelope-from gnats) Resent-Date: Sat, 8 May 2010 11:30:04 GMT Resent-Message-Id: <201005081130.o48BU4LZ055203@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Eugen Konkov Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 831E3106564A for ; Sat, 8 May 2010 11:20:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 739558FC13 for ; Sat, 8 May 2010 11:20:27 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o48BKQoB001258 for ; Sat, 8 May 2010 11:20:26 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o48BKQxM001256; Sat, 8 May 2010 11:20:26 GMT (envelope-from nobody) Message-Id: <201005081120.o48BKQxM001256@www.freebsd.org> Date: Sat, 8 May 2010 11:20:26 GMT From: Eugen Konkov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/146394: IP source address for outgoing connections X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2010 11:30:04 -0000 >Number: 146394 >Category: kern >Synopsis: IP source address for outgoing connections >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat May 08 11:30:03 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Eugen Konkov >Release: 7.1-RELEASE >Organization: >Environment: FreeBSD kes.net.ua 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Sat Jan 3 01:15:39 EET 2009 kes@in.lan:/usr/obj/usr/src/sys/KES_KERN_v7 i386 >Description: I have RealIP/32 on lo0 interface lo0: flags=8049 metric 0 mtu 16384 inet 127.0.0.1 netmask 0xff000000 inet R.E.A.L netmask 0xffffffff netstat -nr Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 10.11.19.49 UGS 0 203508809 vlan4 When some do query to web or bind to R.E.A.L response is from 10.11.19.51 because of default route is on that network. vlan4: flags=8843 metric 0 mtu 1500 ether 00:13:d4:ce:82:16 inet 10.11.19.51 netmask 0xfffffff8 broadcast 10.11.19.55 media: Ethernet autoselect (100baseTX ) status: active vlan: 4 parent interface: nfe0 how to force to response from that IP to which query was arrived? is there 'setfib' like tool? (setip for example) >How-To-Repeat: ifconfig lo0 add R.E.A.L1/32 ifconfig lo1 add R.E.A.L2/32 ifconfig rl4 add 10.11.19.49/30 route add default 10.11.19.50 When some program open socket it will use 10.11.19.49 as source address for outgoing packet. That is impossible to force that programm to use R.E.A.L2 or R.E.A.L1 IP address as souce address for outgoing packets >Fix: create tool like setfib, for example: setfib 1 setip R.E.A.L2 /usr/local/bin/myprogram >Release-Note: >Audit-Trail: >Unformatted: