kern/146394: IP source address for outgoing connections

Eugen Konkov kes-kes at yandex.ru
Sat May 8 11:30:04 UTC 2010


>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 at in.lan:/usr/obj/usr/src/sys/KES_KERN_v7  i386

>Description:
I have RealIP/32 on lo0 interface
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> 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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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 <full-duplex,flag0,flag1>)
        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:


More information about the freebsd-bugs mailing list