From owner-freebsd-questions Fri Jun 15 3:22:49 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mercury.deyton.ru (mercury.deyton.ru [195.58.58.1]) by hub.freebsd.org (Postfix) with ESMTP id D679537B401 for ; Fri, 15 Jun 2001 03:22:44 -0700 (PDT) (envelope-from mike@deyton.ru) Received: from local ([127.0.0.1]) by mercury.deyton.ru with asmtp (Exim 3.16) for ; Fri, 15 Jun 2001 14:22:37 +0400 Date: Fri, 15 Jun 2001 14:22:35 +0400 From: Mike Petrov X-Mailer: The Bat! (v1.51) Business Reply-To: Mike Petrov X-Priority: 3 (Normal) Message-ID: <267957031.20010615142235@deyton.ru> To: freebsd-questions@freebsd.org Subject: choosing correct source IP on multihomed hosts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello. How can I forcely say to any program to use certain source IP? Some programs allow to specify it - ping,traceroute,squid,etc. Many programs do not care about src IP and use ADDR_ANY when creating connections on socket. Kernel chooses appropriate IP address according to routing table. It chooses first IP of interface where packet would be routed. In most cases this is default interface. For example, normally program "telnet" uses IP of default interface, when I telnet to somewhere in Internet. But sometimes I want to force it to use another source IP. Good way to do it: make copy of it to "telnet2", change owner to special user, set SUID bit.But how set default interface _only_ for this user to that I need? -- mike@deyton.ru, ICQ: 9664018 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message