2008-01-16 20:36:40     Auto setup of network interface

Document created by Aaronwu Employee on Aug 5, 2013
Version 1Show Document
  • View in full screen mode

2008-01-16 20:36:40     Auto setup of network interface

Andrew Seddon (UNITED KINGDOM)

Message: 49698    Hi,

 

Running the current SVN, what is the preferred way to automatically setup a network interface? I'm actually using PAND to setup a bnep0 interface on demand. I've had some trouble making the pand daemon run a script. Anyway I'd like to use a more standard way and pass the static IP in from u-boot.

 

Thanks,

 

Andrew

QuoteReplyEditDelete

 

 

2008-01-16 21:01:46     Re: Auto setup of network interface

Mike Frysinger (UNITED STATES)

Message: 49700    the default u-boot will have an "addip" script which will automatically append the required options to the kernel commandline so the kernel can use that at boot.  for documentation on the kernel commandline options, see:

linux-2.6.x/Documentation/kernel-parameters.txt

QuoteReplyEditDelete

 

 

2008-01-16 21:23:02     Re: Auto setup of network interface

Andrew Seddon (UNITED KINGDOM)

Message: 49701    yeah I did try

 

setenv bootargs $(bootargs) ip=192.168.11.3:192.168.11.1:192.168.11.1:255.255.255.0:Test:bnep0:off

 

as per the existing eth0 entry, but it didn't seem to work. I think the problem may be because bnep0 is created dynamically by the daemon when a connection request is recieved. I'm currently getting around this as pand runs /etc/bluetooth/pan/dev-up upon creation of bnep0. But this dosn't solve the problem of passing the address via u-boot.

 

QuoteReplyEditDelete

 

 

2008-01-16 21:38:23     Re: Auto setup of network interface

Mike Frysinger (UNITED STATES)

Message: 49702    yes, i believe ip= will only work for interfaces that are discovered during kernel init.  for bridged interfaces that, for all intents, gets created by userspace, the autoconfiguration on the kernel command line will not be used.

 

in your dev-up script, you could easily parse /proc/cmdline:

eval `sed -n 's|.*\<ip=\([^[:space:]]*\)*.*|\1|p' f | awk -F: '{print "ifconfig " $6 " " $1 }'`

 

i imagine you can come up with other little scripts

Attachments

    Outcomes