[olsr-dev] Fwd: [OLSR-users] olsrd on multiple interfaces

Andreas Tønnesen (spam-protected)
Sun Sep 26 17:48:13 CEST 2004


Hi,

The patch looks ok(at first glance) and I can implement something 
similar for 0.4.8... However - this sounds like a strange setup to me - 
multiple devices using the _same_ IP address sounds like something that 
would mess up your regular IPv4 routing if these devices are not just 
something available to the upper layers. Some questions that pops up:
Isn't the 4 ethernet ports on the WRT in reallity a layer2 switch? Can't 
the switch device be accessed as one interface since all ports are using 
the same address? How does you routing table look(having four devices 
set up within the same subnet) - and on what ports are a regular 
broadcast (10.2.255.255) routed? Are the vlan devices layer2 tagging 
devices(VLAN) - or just some way of accessing the individual ports? Does 
the patch fix your problems(the sockets bind ok to the vlan devices?).

Lots of questions - I'm not trying to be difficult here :-) the bottom 
line is: Please explain whay this kind of setup is nessecarry/useful on 
the routing level. To me it seems that a routing protocol should 
consider the switch _one_ interface, not four.

- Andreas

Pawel Foremski wrote:
> Hi.
> 
> Yesterday I was asking about running olsrd on multiple interfaces with the 
> same IP address. It seems olsrd doesn't support such setup, so I wrote a 
> patch. Could you please tell me what do you think about it?
> 
> ----------  Forwarded Message  ----------
> Subject: [OLSR-users] olsrd on multiple interfaces
> Date: Saturday 25 of September 2004 21:19
> From: Pawel Foremski <(spam-protected)>
> To: (spam-protected)
> 
> Hi!
> 
> I'm running olsrd 0.4.7 on Linksys WRT-54G with OpenWRT firmware. I've got 5
> interfaces on it (1 x wireless, 4 x Ethernet) I'd like to run olsrd on: eth0,
> vlan1, vlan2, vlan3 and vlan4. The IP addresses are the same on each
> interface.
> 
> I'm trying to deploy the following scenario: there are 3 machines, 10.1.0.1
> (pc), 10.3.0.1 (wrt54g nr 2) and 10.2.0.1 (wrt54g) between them (the one I'm
> currently fighting with :P). All of the machines are running olsrd 0.4.7. I'd
> like to make 10.1.0.1 be able to communicate via 10.2.0.1 with 10.3.0.1,
> simple. But the olsrd daemon running at 10.2.0.1 on multiple interfaces seems
> to add all discovered routes only on the first interface from "INTERFACES"
> list. In my setup the list is "vlan1 eth1 vlan2 vlan3 vlan4".
> 
> 10.3.0.1, which I'm trying to contact from 10.1.0.1, is connected to eth1;
> 10.1.0.1 is connected to vlan1. So, olsrd running on 10.2.0.1 properly adds
> the route to 10.1.0.1 (vlan1), but fails to add proper route to 10.3.0.1
> (eth1), using vlan1 instead. Of course I can't contact 10.3.0.1 from
> 10.1.0.1.
> 
> And here is my question - is it a bug, am I missing something obvious or is
>  it a "feature" :P?
> -------------------------------------------------------
> 
> 
> 
> ------------------------------------------------------------------------
> 
> diff -ur ./olsrd-0.4.7/src/interfaces.c ./olsrd-0.4.7-new/src/interfaces.c
> --- ./olsrd-0.4.7/src/interfaces.c	2004-09-09 06:51:09.000000000 +0200
> +++ ./olsrd-0.4.7-new/src/interfaces.c	2004-09-25 22:45:05.000000000 +0200
> @@ -141,6 +141,31 @@
>    return (ifp);
>  }
>  
> +/**
> + *Find the interface with a given name.
> + *
> + *@param name the name of the interface to find.
> + *
> + *@return return the interface struct representing the interface
> + *that matched the name.
> + */
> +struct interface *
> +if_ifwithname(char *name)
> +{
> +  struct interface *ifp;
> +  ifp = ifnet;
> +
> +  while (ifp) 
> +    {
> +      if (!strcmp(ifp->int_name, name))
> +	return ifp;
> +      ifp = ifp->int_next;
> +    }
> +  
> +  return (ifp);
> +}
> +
> +
>  #ifndef WIN32
>  /*
>   *From net-tools lib/interface.c
> diff -ur ./olsrd-0.4.7/src/interfaces.h ./olsrd-0.4.7-new/src/interfaces.h
> --- ./olsrd-0.4.7/src/interfaces.h	2004-09-07 18:10:36.000000000 +0200
> +++ ./olsrd-0.4.7-new/src/interfaces.h	2004-09-25 22:45:23.000000000 +0200
> @@ -132,6 +132,9 @@
>  struct interface *
>  if_ifwithsock(int);
>  
> +struct interface *
> +if_ifwithname(char *);
> +
>  struct	interface *
>  if_ifwithaddr(union olsr_ip_addr *);
>  
> diff -ur ./olsrd-0.4.7/src/link_set.c ./olsrd-0.4.7-new/src/link_set.c
> --- ./olsrd-0.4.7/src/link_set.c	2004-09-18 12:08:49.000000000 +0200
> +++ ./olsrd-0.4.7-new/src/link_set.c	2004-09-25 22:46:00.000000000 +0200
> @@ -282,7 +282,7 @@
>  	 COMP_IP(remote_addr, &tmp_link_set->neighbor_iface_addr))
>  	{
>  
> -	  tmp_if = if_ifwithaddr(&tmp_link_set->local_iface_addr);
> +	  tmp_if = if_ifwithname(tmp_link_set->int_name);
>  
>  	  /* Must be symmetric link! */
>  	  if(!TIMED_OUT(&tmp_link_set->SYM_time))
> @@ -324,7 +324,7 @@
>   */
>  
>  struct link_entry *
> -add_new_entry(union olsr_ip_addr *local, union olsr_ip_addr *remote, union olsr_ip_addr *remote_main, double vtime, double htime)
> +add_new_entry(union olsr_ip_addr *local, union olsr_ip_addr *remote, union olsr_ip_addr *remote_main, double vtime, double htime, char *int_name)
>  {
>    struct link_entry *tmp_link_set, *new_link;
>    struct neighbor_entry *neighbor;
> @@ -368,6 +368,9 @@
>    /* Subtract 1 */
>    new_link->SYM_time.tv_sec -= 1;
>  
> +  new_link->int_name = olsr_malloc(strlen(int_name) + 1, "new link entry interface name");
> +  strcpy(new_link->int_name, int_name);
> +
>    /* L_time = current time + validity time */
>    olsr_get_timestamp((olsr_u32_t) vtime*1000, &new_link->time);
>  
> @@ -520,7 +523,7 @@
>    //timeout_link_set();
>  
>    /* Add if not registered */
> -  entry = add_new_entry(local, remote, &message->source_addr, message->vtime, message->htime);
> +  entry = add_new_entry(local, remote, &message->source_addr, message->vtime, message->htime, in_if->int_name);
>  
>    /* Update link layer info */
>    /* Add to link-layer spy list */
> diff -ur ./olsrd-0.4.7/src/link_set.h ./olsrd-0.4.7-new/src/link_set.h
> --- ./olsrd-0.4.7/src/link_set.h	2004-09-07 18:10:39.000000000 +0200
> +++ ./olsrd-0.4.7-new/src/link_set.h	2004-09-25 22:39:38.000000000 +0200
> @@ -39,6 +39,7 @@
>    struct timeval ASYM_time;
>    struct timeval time;
>    struct neighbor_entry *neighbor;
> +  char *int_name;
>  
>    /*
>     *Hysteresis
> @@ -73,7 +74,7 @@
>  olsr_init_link_set();
>  
>  struct link_entry *
> -add_new_entry(union olsr_ip_addr *, union olsr_ip_addr *, union olsr_ip_addr *, double, double);
> +add_new_entry(union olsr_ip_addr *, union olsr_ip_addr *, union olsr_ip_addr *, double, double, char *);
>  
>  int
>  lookup_link_status(struct link_entry *);
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> olsr-dev mailing list
> (spam-protected)
> https://www.olsr.org/mailman/listinfo/olsr-dev



More information about the Olsr-dev mailing list