Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Debian GNU/Linux Reference Guide
Prev Home Next

10.9 Multi-stage mapping

Suppose your network adapters are hotplugged and you enable automatic configuration as described in Triggering network configuration – hotplug, Section 10.8.2. Suppose further that you need to map logical interfaces to "physical" interfaces depending both on the adapter underlying the physical interface (as described in Dealing with inconsistent naming of interfaces by the kernel, Section 10.7) and on the network connected to the interface (as described, for example, in Logical interface selection using guessnet, Section 10.6.3.1). You can accomplish this with multi-stage mapping.

The first mapping stage takes the hotplug group name and outputs the kernel-assigned interface name if the interface is to be hot plugged. The second mapping stage takes a kernel-assigned interface name and outputs an adapter name. The third mapping stage maps adapter names to logical interface names based on the network environment.

     # Allow hotplug to bring up interfaces
     mapping hotplug
     	script echo
     
     # Determine whether interface is wired or Wi-Fi
     mapping eth?
             script /usr/local/sbin/get-mac-address.sh
             map 02:23:45:3C:45:3C wired
             map 00:A3:03:63:26:93 wifi
     
     # Detect which wired network is available
     mapping wired
             script guessnet-ifupdown
             map work-wired
             map home
     
     # Detect which Wi-Fi network is available
     mapping wifi
             script ifscout
             map starbucks
             map work-wireless
     
     iface work-wired inet static
     	...

Debian GNU/Linux Reference Guide
Prev Home Next

 
 
  Published under the terms of the GNU General Public License Design by Interspire