From owner-freebsd-current@FreeBSD.ORG Sat Dec 18 04:49:57 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C15D16A4CF for ; Sat, 18 Dec 2004 04:49:57 +0000 (GMT) Received: from smtp02.net-yan.com (smtp02.hgcbroadband.com [210.0.255.157]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB40A43D45 for ; Sat, 18 Dec 2004 04:49:55 +0000 (GMT) (envelope-from sam.wun@authtec.com) Received: (qmail 43972 invoked from network); 18 Dec 2004 04:49:53 -0000 Received: from unknown (HELO [192.168.4.70]) (samwun@hgcbroadband.com@[221.126.236.217]) (envelope-sender ) by localhost (qmail-ldap-1.03) with SMTP for ; 18 Dec 2004 04:49:53 -0000 Message-ID: <41C3B6CE.4080704@authtec.com> Date: Sat, 18 Dec 2004 12:49:18 +0800 From: sam User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.unix.bsd.openbsd.misc,comp.unix.bsd.freebsd.misc To: freebsd-current@freebsd.org, freebsd-pf@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Error with sample PF code X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2004 04:49:57 -0000 Hi, I found some sample code in the man pf page (just scoll down to the end of the page, you will see it). After compiled it and give it a shoot, it returned error: # pfctl -sn nat on tun0 inet from 192.168.9.0/24 to any -> (tun0) round-robin nat on tun0 inet from 192.168.4.0/24 to any -> (tun0) round-robin nat on tun0 inet from 172.16.0.0/24 to any -> (tun0) round-robin rdr on tun0 inet proto tcp from any to 1.2.3.4 port = 3000 -> 192.168.4.254 port 25 # ./a.out ./a.out ./a.out 192.168.4.254 25 1.2.3.4 3000 a.out: DIOCNATLOOK: No such file or directory I may be have overlooked something. Your suggestion is highly appreciated. Thanks Sam.