From owner-freebsd-net@FreeBSD.ORG Sat Jun 14 06:38:43 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B4B8E37B401 for ; Sat, 14 Jun 2003 06:38:43 -0700 (PDT) Received: from cage.simianscience.com (cage.simianscience.com [64.7.134.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65C0C43F75 for ; Sat, 14 Jun 2003 06:38:42 -0700 (PDT) (envelope-from mike@sentex.net) Received: from house.sentex.net (fcage [192.168.0.2])h5EDcdlD095712; Sat, 14 Jun 2003 09:38:39 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <5.2.0.9.0.20030614092420.07360cc0@192.168.0.12> X-Sender: mdtancsa@192.168.0.12 X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 14 Jun 2003 09:36:39 -0400 To: Vincent Jardin From: Mike Tancsa In-Reply-To: <200306141247.40278.vjardin@wanadoo.fr> References: <5.2.0.9.0.20030613171118.07821488@209.112.4.2> <5.2.0.9.0.20030613171118.07821488@209.112.4.2> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: amavis-20020220 cc: freebsd-net@freebsd.org Subject: Re: problems adding interfaces with zebra X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2003 13:38:44 -0000 At 12:47 PM 6/14/2003 +0200, Vincent Jardin wrote: > > ifconfig: ioctl (SIOCAIFADDR): File exists > > > > Because the route is already installed locally as pointing to machine A via > > interface B1. (.i.e. I have redistribute connected enabled) > > > > Short of killing ospfd and zebra how do I get around this ? > >su-2.05b# route -n get 12.0.0.0 > route to: 12.0.0.0 >destination: 12.0.0.0 > mask: 255.0.0.0 > gateway: 192.168.0.1 > interface: fxp0 > flags: >su-2.05b# route -n delete 12.0.0.0 >delete net 12.0.0.0 > >su-2.05b# ifconfig fxp0 12.0.0.1 alias >su-2.05b# route -n get 12.0.0.0 > route to: 12.0.0.0 >destination: 12.0.0.0 > mask: 255.0.0.0 > interface: fxp0 > flags: Thanks, the problem is, if I do a "route delete" by the time I go to set the interface, the route is re-added by zebra :-( So I would have to kill (or somehow suspend?) zebra to add the route properly? Any other ways ? # route get 12.0.0.112/28 route to: 12.0.0.112 destination: 12.0.0.112 mask: 255.255.255.240 gateway: 64.7.143.42 interface: vlan1 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0 # ping 12.0.0.112 PING 12.0.0.112 (12.0.0.112): 56 data bytes ^C --- 12.0.0.112 ping statistics --- 2 packets transmitted, 0 packets received, 100% packet loss iolite3# route get 192.168.0.40/29 route to: 192.168.0.40 destination: 192.168.0.40 mask: 255.255.255.248 interface: vlan1 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 -646415 # In the case of the 12.0.0.112/28 network I guess i need to get the kernel and zebra to know that its not flags: but flags: What about some ifconfig hackery ? Is this not the stop where it dies ? if (newaddr && (setaddr || setmask)) { strncpy(afp->af_addreq, name, sizeof ifr.ifr_name); if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) Perror("ioctl (SIOCAIFADDR)"); } What if I added a check for a flag/param (e.g. -force) if (newaddr && (setaddr || setmask) && !FORCE ) { strncpy(afp->af_addreq, name, sizeof ifr.ifr_name); if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) Perror("ioctl (SIOCAIFADDR)"); } ---Mike -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike