From owner-freebsd-isp Mon Aug 5 11:23:34 2002 Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D71837B400 for ; Mon, 5 Aug 2002 11:23:30 -0700 (PDT) Received: from post.xecu.net (post.xecu.net [216.127.136.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D21F43E42 for ; Mon, 5 Aug 2002 11:23:30 -0700 (PDT) (envelope-from andy@xecu.net) Received: from thunder.xecu.net (thunder.xecu.net [216.127.136.208]) by post.xecu.net (Postfix) with ESMTP id 8163A4AD1; Mon, 5 Aug 2002 14:23:19 -0400 (EDT) Received: by thunder.xecu.net (Postfix, from userid 100) id EFD2B250FF; Mon, 5 Aug 2002 14:23:12 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by thunder.xecu.net (Postfix) with ESMTP id EA31E250FC; Mon, 5 Aug 2002 14:23:12 -0400 (EDT) Date: Mon, 5 Aug 2002 14:23:12 -0400 (EDT) From: Andy Dills To: Max Cc: John Hay , Kal Torak , FreeBSD ISP Subject: Re: Routing based on source? In-Reply-To: <006401c23c93$17cc9de0$04ef10ac@wireless> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 5 Aug 2002, Max wrote: > > > Hi all, > > > > > > I have a situation where I want to route packets out different > > > interfaces based on their source ip address... I dont care about > > > the destination in this case, only where its comming from.. > > > > > > Is this possible? And if so how? > > > > You can use ipfw fwd to do that. > > > > John > > How? Hmm...I'm guessing you didn't bother to read the man page? fwd ipaddr[,port] Change the next-hop on matching packets to ipaddr, which can be an IP address in dotted quad or a host name. If ipaddr is not a directly-reachable address, the route as found in the local routing table for that IP is used instead. If ipaddr is a local address, then on a packet entering the system from a remote host it will be diverted to port on the local machine, keeping the local address of the socket set to the original IP address the packet was destined for. This is intended for use with transparent proxy servers. If the IP is not a local address then the port number (if specified) is ignored and the rule only applies to packets leaving the system. This will also map addresses to local ports when packets are generated locally. The search terminates if this rule matches. If the port number is not given then the port number in the packet is used, so that a packet for an external machine port Y would be forwarded to local port Y. The kernel must have been compiled with the IPFIREWALL_FORWARD option. So, in other words: ipfw add fwd ip from to any Andy xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Andy Dills 301-682-9972 Xecunet, LLC www.xecu.net xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Dialup * Webhosting * E-Commerce * High-Speed Access To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message