[Asterisk-Users] Multiple NICs on Asterisk box

Zoltan Szecsei zoltans at geograph.co.za
Thu Jul 14 07:31:59 MST 2005


Tzafrir Cohen wrote:

>If you want useful answers from people here, provide some data for
>people to work with. As for that data: people asked you to look at some
>specific files.
>
>E.g: frankly I still can't tell if both cards get loaded by the same
>module or by different modules. Frankly, I can't think of a good reason
>why two different boots of the same machine with very similar config 
>would have different module/card load order.
>
>  
>
OK - time to summarise so that I dont end up with bitty answers and 
attempts from all the various suggestions I have.

Tzafrir - your accusation in your first paragraph above is correct - I 
missed your pointer to the HOW-TO and I threw away the PERSISTENT_NAME 
idea as intuitively I didnt think it would work. Apologies to all.

Now, lets go through it in this order.

1) I need to show conclusively what is going funny.

2) The PERSISTENT_NAME idea

3)  The alias suggestion

4)  The manual  rmmod/modprobe idea


Lets go:

+++++++++++++++++++++++++++++++++++++++++++++++
1) I need to show conclusively what is going funny.
 OK, till now the machine was up since yesterday. I copied the 
/var/log/boot.msg file and powered off & on again (not init 6). As luck 
would have it, the NICs swopped around, so here are the exerpts from bot 
boot.msg file. (No, don't be cynical - I haven't just created these 
entries in an editer :-) )

===== exerpt ========
Start Unicode mode
doneLoading console font lat9w-16.psfu  -m trivial G0:loadable
Waiting for zap to come online ...OK

doneSetting up network interfaces:
    lo       
    lo        IP address: 127.0.0.1/8
done    eth0      device: Realtek Semiconductor Co., Ltd. RTL-8169 
Gigabit Ethernet (rev 10)
    eth0      configuration: eth-id-00:11:09:7f:15:70
    eth0      IP address: 192.168.0.100/24  
done    eth1      device: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 74)
    eth1      configuration: eth-id-00:50:da:df:4a:3f
    eth1      IP address: 192.168.1.100/24  
doneSetting up service network  .  .  .  .  .  .  .  .  .  .  .  .  .  
.  .  .done
===== exerpt ========
Start Unicode mode
doneLoading console font lat9w-16.psfu  -m trivial G0:loadable
doneSetting up network interfaces:
    lo       
    lo        IP address: 127.0.0.1/8
done    eth0      device: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 74)
    eth0      configuration: eth-id-00:50:da:df:4a:3f
    eth0      IP address: 192.168.1.100/24  
done    eth1      device: Realtek Semiconductor Co., Ltd. RTL-8169 
Gigabit Ethernet (rev 10)
    eth1      configuration: eth-id-00:11:09:7f:15:70
    eth1      IP address: 192.168.0.100/24
doneSetting up service network  .  .  .  .  .  .  .  .  .  .  .  .  .  
.  .  .done

OK - now you can see what's happening (I've removed the init.d/zaptel 
entry which is why it is not occuring the second time)


+++++++++++++++++++++++++++++++++++++++++++++++
2) The PERSISTENT_NAME idea
I first loaded PERSISTENT_NAME=eth2 (and eth3) in the two files so that 
I could check if my software was checking against eth0 (in which case it 
would have failed as only eth2 and eth3 exists) - and (as luck would 
have it) this time the 3COM card initialised first, and the software 
authenticated correctly. This means to me that the eth0 name is 
irrelevant and the SW authenticates against the MAC address of the1st 
nic initialised.
So, I need not worry about the interface name, but I do have to lock 
down the 3COM nic so that it initialises first.

+++++++++++++++++++++++++++++++++++++++++++++++
3)  The alias suggestion
I did not understand this at the time I received it - Had I noticed 
Tzafrir's pointer to the ethernet HOWTO, I would have realised that 
alias in this context was not giving an alias to the eth0/1 names. Oops 
sorry, again.
However, although I discarded this idea originally for the wrong reason, 
it still shouldn't (and didn't) solve the problem. If the names eth0 & 
eth1 are defined only after the NICs are sensed, then force-loading the 
wrong module should not force the interfaces to swop around.
I added the 2 alias entries into /etc/modprobe.conf.local and did an 
init 6. The darn 3com came up first so nothing was proven (although the 
hopes ran higher). I powered down and powered up and luckily the Realtek 
came up first - and as eth0. I now expected the 3c59x module to be 
forced onto the Realtek interface (due to the alias's), but there were 
no boot time or other messages and I could ping the network - but not 
authenticate my SW as the 3com NIC was now 2nd in  the que.

+++++++++++++++++++++++++++++++++++++++++++++++
4)  The manual  rmmod/modprobe idea

##/usr/sbin/rcroute stop        # locate rcroute showed nothing for my 
SuSE 9.3
/sbin/rcnetwork stop
/sbin/rmmod 3c59x
/sbin/rmmod r8169
/sbin/modprobe 3c59x
/sbin/modprobe r8169
/sbin/rcnetwork start
## /usr/sbin/rcroute start

Brilliant.
This does exactly what I need.
Thanks to Hilton Williams for hitting the nail on the head - but thanks 
also to all who endured the 12 (now 13) emails in this thread.
What's also nice about this method is that the PERSISTENT_NAME works 
every time (and forces the 3COM to retain eth0), whereas at boot time, 
if the Realtek comes up first, I get a boot.msg error saying "Cannot 
change name of eth0 to eth1: File exists."

Now.... to dig around /etc/rc.x to see where to put these commands.....

+++++++++++++++++++++++++++++++++++++++++++++++
I'm glad it's over because I have rebooted so many times that I am 
scared if I do it one more time the boot time splash screen will start 
looking like M$ :-)


Cheers & chat soon,
Zoltan.


-- 

==================================
Geograph (Pty) Ltd
P.O. Box 31255
Tokai
7966
Tel:    +27-21-7018492
Fax:	+27-86-6115323
Mobile: +27-83-6004028
==================================





More information about the asterisk-users mailing list