public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] Fwd: Batman-adv simple configuration example
@ 2012-05-10 22:16 Pedro Nuno Costa Rodrigues
  2012-05-10 22:24 ` Pedro Nuno Costa Rodrigues
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pedro Nuno Costa Rodrigues @ 2012-05-10 22:16 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking


Hello again!

First of all thank's Sven Eckelmann and Guido Iribarren for your
replies and for the attention in my issue.

I would like to say that i already found the solution, as you can see below.
I couldn't split the radios on the wireless network, because i'm using
only chips broadcom (and it isn't possible to have more than 1 radio
interface). When i said that i only need a simple two router network,
doesn't mean that i only going to use 2 routers... the gold is to use
many of them in a mesh network, but i needed to start with a simple 2
mesh configuration router configuration.

After some configuration, it worked correctly in ad-hoc mode... and to
the clients access the mesh through wireless i´m going to use another
router linked by cable (ethernet) using lan ports, with dd-wrt
firmware (or something like that) as a AP -access point (only used to
forward the signal to wireless). By cable it isn't necessary an access
point, only plug the cable in batman-adv node.



I'm using backfire (openwrt build):

cat /home/pedro/backfire/feeds/packages/net/batman-adv/Makefile | grep 2012
# Copyright (C) 2010-2012 OpenWrt.org
PKG_VERSION:=2012.0.0
BATCTL_VERSION:=2012.0.0


The batman-adv-devel version didn't work...:

In the:https://dev.openwrt.org/wiki/GetSource

downloaded: svn co svn://svn.openwrt.org/openwrt/trunk/

with this feed in feeds.conf.default:
src-svn batman http://downloads.open-mesh.org/svn/openwrt-feed/

(i know this is a issue related with openwrt, but i must explain how i did)

this is the version of the batman-adv-devel:
cat /home/pedro/trunk/feeds/packages/net/batman-adv/Makefile | grep 2012
PKG_VERSION:=2012.1.0
BATCTL_VERSION:=2012.1.0

root@OpenWrt:~# batctl -v
batctl 54b7d54 [batman-adv: master-b0f3829]

the error was using the same configurations file (below) that worked
with batman-adv backfire stable release:
root@OpenWrt:/lib/batman-adv# batman-adv start
/usr/sbin/batman-adv: eval: line 1: can't
create/sys/class/net/bat0/mesh/orig_interval: nonexistent directory

/usr/sbin/batman-adv: eval: line 1: can't create
/sys/class/net/bat0/mesh/log_level: nonexistent directory

/usr/sbin/batman-adv: eval: line 1: can't create
/sys/class/net/bat0/mesh/bonding: nonexistent
directory/usr/sbin/batman-adv: eval: line 1: can't create
/sys/class/net/bat0/mesh/fragmentation: nonexistent directory

/usr/sbin/batman-adv: eval: line 1: can't create
/sys/class/net/bat0/mesh/gw_bandwidth: nonexistent directory

/usr/sbin/batman-adv: eval: line 1: can't create
/sys/class/net/bat0/mesh/gw_mode: nonexistent
directory/usr/sbin/batman-adv: eval: line 1: can't create
/sys/class/net/bat0/mesh/vis_mode: nonexistent directory

/usr/sbin/batman-adv: eval: line 1: can't create
/sys/class/net/bat0/mesh/ap_isolation: nonexistent directory




I tryed to analyze if the problem was with the  "crc16" lib in the
configuration files, but it wasn't... the configuration files were
like the backfire stable release...

pedro@rodrigues:~/trunk/feeds/packages/net/batman-adv/files/lib/batman-adv$ vi
config.sh 
#!/bin/sh
bat_load_module(){
        [ -d "/sys/module/batman_adv/" ] && return

        . /etc/functions.sh 
         load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-batman-adv*}


etc..........

This is a issue to analyze...

Going back to the stable release that worked fine:
this is the server file of batman-adv configuration(with # comment is
the client version modifications):

root@OpenWrt:/etc/config# vi batman-adv
config 'mesh' 'bat0'       
      option 'interfaces' 'wifi'
      option 'aggregated_ogms' '1'
      option 'ap_isolation' '0'
      option 'bonding' '0' 
      option 'fragmentation' '1'
      option 'gw_bandwidth' '5mbit/1024kbit' #comented line in client
mode                option 'gw_mode' 'server'              #'client' 
      #option 'gw_sel_class'      #option 'gw_sel_class' '2' 
      option 'log_level' 'all'
      option 'orig_interval' '1000'
      option 'vis_mode' 'server'             #option 'vis_mode' 'client'
------------------------------------

this is the dhcp configuration:


root@OpenWrt:/etc/config# vi dhcp
config dnsmasq
        option domainneeded     1
        option boguspriv        1
        option filterwin2k      0  # enable for dial on demand
        option localise_queries 1
        option rebind_protection 1  # disable if upstream must serve
RFC1918 addresses
        option rebind_localhost 1  # enable for RBL checking and 
similar services          #list rebind_domain example.lan  # whitelist
RFC1918 responses for domains
         option local    '/lan/'
        option domain   'lan'
        option expandhosts      1
        option nonegcache       0
        option authoritative    1
        option readethers       1
        option leasefile        '/tmp/dhcp.leases'
        option resolvfile       '/tmp/resolv.conf.auto'
        #list server            '/mycompany.local/1.2.3.4'
        #option nonwildcard     1
        #list interface         br-lan
        #list notinterface      lo
        #list bogusnxdomain     '64.94.110.11'

config dhcp lan
        option interface        lan
        option start    51
        option limit    70
        #option leasetime       12h
	option force	1   #this line is only for server router, the          
                   #one who is going to distribute the IP's to the
clients 

config dhcp wan
        option interface        wan
        option ignore   1
____________________________________

this is the network file configuration:

root@OpenWrt:/etc/config# vi network
#### VLAN configurationconfig switch eth0
        option enable   1

config switch_vlan eth0 0
        option device   "eth0"
        option vlan     0
        option ports    "1 2 3 4 5"

config switch_vlan eth0_1
        option device   "eth0"
        option vlan     1
        option ports    "0 5"                   

#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0 bat0 wlan0"
        option proto    static
        option ipaddr   10.3.1.1                #10.3.1.X for other routers
        option netmask  255.255.255.0
        option broadcast 10.3.1.255
        option mtu      1500

#### WLAN configuration
config interface        wifi
        option proto    none
        option ifname   "wlan0"
        #option ipaddr   10.1.1.1        #option netmask  255.255.255.0
        option mtu      1528

#### WAN configuration
config interface        wan
        option ifname   "eth0.1"
        option proto    dhcp  

________________________________-
this is the wireless file configuration:

root@OpenWrt:/etc/config# vi wireless
config wifi-device  radio0
        option type     mac80211
        option channel  6
        option phy      phy0
        option hwmode   11g
        option country  PT
        option txpower  20
        option disabled 0


config wifi-iface
        option device   radio0
        option network  wifi
        option mode     adhoc
        option ssid     PR
        option bssid XX:XX:XX:XX:XX:XX   #the bssid must be the same
in all routers
        option encryption none


______________________________________-

all these configuration files are located in "/etc/config".

As you can see the mesh interface is the wireless "wifi":
the bat0 interface it appears only in the lan bridge;
and it worked fine.

root@OpenWrt:/etc/config# batctl if
wlan0: active

root@OpenWrt:/etc/config# batctl o
 [B.A.T.M.A.N. adv 2012.0.0, MainIF/MAC: wlan0/00:13:10:7c:da:73
(bat0)]  Originator      last-seen (#/255)           Nexthop
[outgoingIF]:   Potential nexthops ...00:06:25:00:63:7b    0.228s  
(246) 00:06:25:00:63:7b [     wlan0]: 00:06:25:00:63:7b (246)

root@OpenWrt:/etc/config# batctl vd dot
digraph {
	"00:13:10:7c:da:73" -> "00:06:25:00:63:7b" [label="1.000"]
	"00:13:10:7c:da:73" -> "76:0f:22:e4:5f:d8" [label="TT"]
	subgraph "cluster_00:13:10:7c:da:73" {
		"00:13:10:7c:da:73" [peripheries=2]
	}
	"00:06:25:00:63:7b" -> "00:13:10:7c:da:73" [label="1.214"]
	"00:06:25:00:63:7b" -> "56:71:dc:31:13:2c" [label="TT"]
	subgraph "cluster_00:06:25:00:63:7b" {
		"00:06:25:00:63:7b" [peripheries=2]
	}
}

 using the xdot ubuntu application it made the figure (.png) that
shows the batman-adv mesh picture.

The only thing that didn't start with the boot of the routers was the:
-option 'gw_bandwidth' '5mbit/1024kbit'
-option 'gw_mode' 'server'
-option 'vis_mode' 'server'

it was necessary to start manually... the rest worked weel in the
boot.Just one thing before i forget... the router "server" must be the
first one to start (switch on)... we must wait until it finish the
boot and then we can start the client router...

(the problem is probably the definition who is the master -IP
distribution and so on...)(i used the "option force 1 in the dhcp
configuration file, but didn't worked...) if we start the client first
it will not be possible to access the internet, supposed the ISP is
connected with the "server" router... the ad-hoc mode and the mesh
network works the same way (works fine)...

is a issue to study (yes i know that is a openwrt problem, and there
are a bunch of openwrt problems here).My gold is to contribute with
something here, and to get my job done as well.

For now i stay here, and thank you for your lights and publications,
they helped me a lot!!


Best regards,Pedro Rodrigues - Portugal



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] Fwd: Batman-adv simple configuration example
  2012-05-10 22:16 [B.A.T.M.A.N.] Fwd: Batman-adv simple configuration example Pedro Nuno Costa Rodrigues
@ 2012-05-10 22:24 ` Pedro Nuno Costa Rodrigues
  2012-05-11  8:25 ` Marek Lindner
  2012-05-11 13:07 ` Guido Iribarren
  2 siblings, 0 replies; 5+ messages in thread
From: Pedro Nuno Costa Rodrigues @ 2012-05-10 22:24 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

I forgot to say that i'm using wrt54gs linksys routers versions 1.1 and 3.

:-)

Thank you very much!
Pedro Rodrigues

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] Fwd: Batman-adv simple configuration example
  2012-05-10 22:16 [B.A.T.M.A.N.] Fwd: Batman-adv simple configuration example Pedro Nuno Costa Rodrigues
  2012-05-10 22:24 ` Pedro Nuno Costa Rodrigues
@ 2012-05-11  8:25 ` Marek Lindner
  2012-05-11 13:07 ` Guido Iribarren
  2 siblings, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2012-05-11  8:25 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Friday, May 11, 2012 06:16:49 Pedro Nuno Costa Rodrigues wrote:
> The batman-adv-devel version didn't work...:
> 
> In the:https://dev.openwrt.org/wiki/GetSource
> 
> downloaded: svn co svn://svn.openwrt.org/openwrt/trunk/
> 
> with this feed in feeds.conf.default:
> src-svn batman http://downloads.open-mesh.org/svn/openwrt-feed/

That is the package for developers. You only want to use it if you really know 
what you are doing.


> The only thing that didn't start with the boot of the routers was the:
> -option 'gw_bandwidth' '5mbit/1024kbit'
> -option 'gw_mode' 'server'
> -option 'vis_mode' 'server'

I just tried to replicate the problem but I can't (using the latest trunk 
package). Here my simple batman-adv configuration file:

cat /etc/config/batman-adv 

config 'mesh' 'bat0'
        option 'interfaces' 'eth1'
        option 'vis_mode' 'server'
        option 'gw_mode' 'server'
        option 'gw_bandwidth' '5mbit/1024kbit'


The corresponding logread output after starting batman-adv:

root@OpenWrt:/# batman-adv start
batman_adv: bat0: Adding interface: eth1
batman_adv: bat0: Interface activated: eth1
batman_adv: bat0: Changing gateway bandwidth from: '41' to: '49' (propagating: 
4MBit/1024KBit)
batman_adv: bat0: Changing gw mode from: off to: server
batman_adv: bat0: Changing vis mode from: client to: server

Regards,
Marek

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] Fwd: Batman-adv simple configuration example
  2012-05-10 22:16 [B.A.T.M.A.N.] Fwd: Batman-adv simple configuration example Pedro Nuno Costa Rodrigues
  2012-05-10 22:24 ` Pedro Nuno Costa Rodrigues
  2012-05-11  8:25 ` Marek Lindner
@ 2012-05-11 13:07 ` Guido Iribarren
  2012-05-12 18:22   ` Pedro Nuno Costa Rodrigues
  2 siblings, 1 reply; 5+ messages in thread
From: Guido Iribarren @ 2012-05-11 13:07 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Thu, May 10, 2012 at 7:16 PM, Pedro Nuno Costa Rodrigues
<pedroncr@sapo.pt> wrote:
>
> (the problem is probably the definition who is the master -IP distribution
> and so on...)(i used the "option force 1 in the dhcp configuration file, but
> didn't worked...) if we start the client first it will not be possible to
> access the internet, supposed the ISP is connected with the "server"
> router... the ad-hoc mode and the mesh network works the same way (works
> fine)...

You probably want to use

config dhcp lan
  option "ignore" "1"

in client router,

instead of using "option force 1" in server router

http://wiki.openwrt.org/doc/uci/dhcp#dhcp.pools

>
> is a issue to study (yes i know that is a openwrt problem, and there are a
> bunch of openwrt problems here).My gold is to contribute with something
> here, and to get my job done as well.

Of all the problems I bumped into, just a couple turned out to be
"openwrt problems", and because of using Attitude Adjustment.
Most of the issues were my fault, of not reading the documentation
thoroughly, or not understanding it :)

Regards,

Guido

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] Fwd: Batman-adv simple configuration example
  2012-05-11 13:07 ` Guido Iribarren
@ 2012-05-12 18:22   ` Pedro Nuno Costa Rodrigues
  0 siblings, 0 replies; 5+ messages in thread
From: Pedro Nuno Costa Rodrigues @ 2012-05-12 18:22 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking


Citando Guido Iribarren <guidoiribarren@buenosaireslibre.org>:

> On Thu, May 10, 2012 at 7:16 PM, Pedro Nuno Costa Rodrigues
> <pedroncr@sapo.pt> wrote:
>>
>> (the problem is probably the definition who is the master -IP distribution
>> and so on...)(i used the "option force 1 in the dhcp configuration file, but
>> didn't worked...) if we start the client first it will not be possible to
>> access the internet, supposed the ISP is connected with the "server"
>> router... the ad-hoc mode and the mesh network works the same way (works
>> fine)...
>
> You probably want to use
>
> config dhcp lan
>   option "ignore" "1"
>
> in client router,
>
> instead of using "option force 1" in server router
>
> http://wiki.openwrt.org/doc/uci/dhcp#dhcp.pools
>
>>
>> is a issue to study (yes i know that is a openwrt problem, and there are a
>> bunch of openwrt problems here).My gold is to contribute with something
>> here, and to get my job done as well.
>
> Of all the problems I bumped into, just a couple turned out to be
> "openwrt problems", and because of using Attitude Adjustment.
> Most of the issues were my fault, of not reading the documentation
> thoroughly, or not understanding it :)
>
> Regards,
>
> Guido




you are right!
problem solved. no matter what router starts first, every node will  
allow access to ISP provider...

:-)
Thanks for the tip Guido!

best regards
Pedro Rodrigues



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-12 18:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-10 22:16 [B.A.T.M.A.N.] Fwd: Batman-adv simple configuration example Pedro Nuno Costa Rodrigues
2012-05-10 22:24 ` Pedro Nuno Costa Rodrigues
2012-05-11  8:25 ` Marek Lindner
2012-05-11 13:07 ` Guido Iribarren
2012-05-12 18:22   ` Pedro Nuno Costa Rodrigues

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox