LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > neonsignal
User Name
Password

Notices


Rate this Entry

automated network settings for a laptop

Posted 05-24-2012 at 06:09 AM by neonsignal

Sometimes when a laptop is used on multiple networks (such as work and home), there are different network settings to be configured (particularly if static settings are required).

The guessnet package can be used to augment ifupdown for this purpose; guessnet allows automated tests to be run when the network interface is initializing (such as testing the router mac address) as a way of choosing a configuration.

An example would be mapping eth0 to a static network setting if a particular router is seen, otherwise defaulting to dhcp. This would be set up in /etc/network/interfaces:

Code:
mapping eth0
   script guessnet-ifupdown
   map default: default
   map timeout: 10
   map verbose: true
   map autofilter: true
iface eth0-home inet static
   test peer address router-IP mac router-MAC source own-IP
   static network settings
   ...
iface default inet dhcp
The default mapping indicates the fallback configuration should the other configuration tests fail. The autofilter selects test stanzas that begin with the name of the interface being configured; there can be multiple tested configurations, which are tested concurrently.
Posted in Uncategorized
Views 890 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 08:47 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration