Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Wiki / Kb89

Kb89

Emulab FAQ: Using the Testbed: Can I specify specific network interfaces on the nodes for the links in my topology?

Emulab FAQ: Using the Testbed: Can I specify specific network interfaces on the nodes for the links in my topology?

At this time it isn't possible to bind the links in your experiment to specific interfaces on the nodes. However, most people can abstract away the need to know which interface is being used for what by utilizing mapping information catalogued on each individual node.

For example, the file /var/emulab/boot/ifmap contains mappings from IP and MAC address to network interface. A typical entry looks like this:

em2 10.1.143.2 000423b73e88

Where the fields are: {interface name} {IP address} {MAC address}. This mapping file can easily be parsed by a simple script or snippet of code.

If you are using automatic IP assignment (which most people do, and should in most cases!), then you may not know which IPs you will be using ahead of time, but will instead know which next hop or end node you wish to communicate with. In this case, the /etc/hosts file is the first place to start since it contains mappings from {hostname} and {hostname}-{linkname} to IP address (more information on node naming can be found here.) Once you have the IP address you care about, you can use the "route get" command on FreeBSD or the "ip route get" command on Linux to find out which interface will transmit packets destined to that IP.

NOTE: Please be aware that when using automatic IP assignment, IP addresses are consistent across swapins for links in your topology only if you do not modify or recreate (terminate then create) your experiment. I.e., swapin and swapout operations will not alter the IP assignment, but other operations will re-run the IP assigner.