From owner-freebsd-questions@FreeBSD.ORG Thu Jul 8 22:21:00 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1523716A4CE for ; Thu, 8 Jul 2004 22:21:00 +0000 (GMT) Received: from internet.potentialtech.com (h-66-167-251-6.phlapafg.covad.net [66.167.251.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id E35E343D39 for ; Thu, 8 Jul 2004 22:20:59 +0000 (GMT) (envelope-from wmoran@potentialtech.com) Received: from working.potentialtech.com (pa-plum-cmts1e-68-68-113-64.pittpa.adelphia.net [68.68.113.64]) by internet.potentialtech.com (Postfix) with ESMTP id 3CCFE69A39; Thu, 8 Jul 2004 18:20:59 -0400 (EDT) Date: Thu, 8 Jul 2004 18:20:58 -0400 From: Bill Moran To: "Per olof Ljungmark" Message-Id: <20040708182058.0419994a.wmoran@potentialtech.com> In-Reply-To: <40EDBCC7.8010007@intersonic.se> References: <40EDBCC7.8010007@intersonic.se> Organization: Potential Technologies X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-portbld-freebsd4.9) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: add route called from script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2004 22:21:00 -0000 "Per olof Ljungmark" wrote: > Hi all, > > I am experimenting with openvpn-2 and so far it looks promosing. As this > version of openvpn can assign client addresses similar to dhcp, I need > to find out how to assign a route from a script, like (this is the > client end, running FreeBSD): > > [simplifed example] > #!/bin/sh > openvpn --daemon --config my-vpn.conf > route add 192.168.0.0/16 I'm no guru for either of these commands, but I'm guessing this is a canonical job for sed and/or awk. Something like: IPADDR = `ifconfig | awk ''` route add 192.168.0.0/16 $IPADDR I hope this is helpful, sorry I don't have a more precise answer. -- Bill Moran Potential Technologies http://www.potentialtech.com