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:
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.
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
Total Comments 0