Register a domain and help support LQ
Go Back > Blogs > neonsignal
User Name


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:

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 373 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 07:42 AM.

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