Select an Interface on Linux

Linux network interfaces are referenced by name. Use Linux utility ifconfig to determine the names of interfaces on your host. By default, Toolkit programs communicate with powerline devices on interface eth1 but another interface can be specified on the command line with the -i option:

Example 5.1.  Selecting another Interface on Linux

# int6k -i eth3 ...

In the previous example, int6k will send and receive frames on interface eth3 instead of the default interface. Having to specify the interface can become become tedious when entering commands manually. An alternative method involves setting environment variable PLC to your preferred Ethernet interfaces, as follows:

Example 5.2.  Changing the Default Interface on Linux

# export PLC="eth2"

In the previous example, environment variable PLC is defined and exported, making it available to all programs running under the current console session. This command can be included in ~/.profile or /etc/profile or in /etc/environment on Debian ™ and Ubuntu™ systems.

Example 5.3.  Finding Interfaces on Linux

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:60:97:05:97:0C  
          inet addr:192.168.170.179  Bcast:192.168.170.255  Mask:255.255.255.0
          inet6 addr: fe80::260:97ff:fe05:970c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:52130758 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59629414 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:43781526 (41.7 MiB)  TX bytes:4226651392 (3.9 GiB)
          Interrupt:209 Base address:0xe000 

eth1      Link encap:Ethernet  HWaddr 00:0F:EA:10:D5:1C  
          inet addr:192.168.99.1  Bcast:192.168.99.255  Mask:255.255.255.0
          inet6 addr: fe80::20f:eaff:fe10:d51c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:68711621 errors:0 dropped:0 overruns:0 frame:0
          TX packets:70059644 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3449044517 (3.2 GiB)  TX bytes:1328494982 (1.2 GiB)
          Interrupt:217 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:177789 errors:0 dropped:0 overruns:0 frame:0
          TX packets:177789 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:599522176 (571.7 MiB)  TX bytes:599522176 (571.7 MiB)

The previous example demonstrates the use of Linux ifconfig utility to identify available network interfaces by name and MAC address.

If your computer has multiple Ethernet interface cards installed, you can connect each card to a different Atheros powerline device and communicate with each device, independently, from one console session (window) by specifying the appropriate interface card with each command. It is also possible to open multiple console sessions (windows), each having a unique enviroment, and assign a different value for PLC in each enviroment.