problems adding interfaces with zebra
Mike Tancsa
mike at sentex.net
Sat Jun 14 06:38:44 PDT 2003
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: <UP,GATEWAY,DONE,STATIC,PRCLONING>
>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: <UP,DONE,CLONING>
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: <UP,GATEWAY,DONE,PROTO1,PRCLONING>
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: <UP,DONE,CLONING>
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: <UP,GATEWAY,DONE,PROTO1,PRCLONING>
but
flags: <UP,DONE,CLONING>
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 at sentex.net
Providing Internet since 1994 www.sentex.net
Cambridge, Ontario Canada www.sentex.net/mike
More information about the freebsd-net
mailing list