ch05s02.html 6.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Select an Interface on Linux</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><meta name="keywords" content="Intellon, Atheros, Qualcomm, HomePlug, powerline, communications, INT6000, INT6300, INT6400, AR7400, AR7420"><link rel="home" href="index.html" title="Qualcomm Atheros Open Powerline Toolkit"><link rel="up" href="ch05.html" title="Chapter 5.  Procedures"><link rel="prev" href="ch05.html" title="Chapter 5.  Procedures"><link rel="next" href="ch05s03.html" title="Select an Interface on Windows"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
  2. Select an Interface on Linux
  3. </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05.html">Prev</a> </td><th width="60%" align="center">Chapter 5. 
  4. Procedures
  5. </th><td width="20%" align="right"> <a accesskey="n" href="ch05s03.html">Next</a></td></tr></table><hr></div><div class="section" title="Select an Interface on Linux"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="procedure-select-interface-linux"></a>
  6. Select an Interface on Linux
  7. </h2></div></div></div><p>
  8. <span class="application">Linux</span> network interfaces are referenced by name. Use Linux utility <span class="application">ifconfig</span> to determine the names of interfaces on your host. By default, Toolkit programs communicate with powerline devices on interface <code class="varname">eth1</code> but another interface can be specified on the command line with the <strong class="userinput"><code>-i</code></strong> option:
  9. </p><div class="example"><a name="idp22248040"></a><p class="title"><b>Example 5.1. 
  10. Selecting another Interface on Linux
  11. </b></p><div class="example-contents"><pre class="screen">
  12. # int6k -i eth3 ...
  13. </pre></div></div><br class="example-break"><p>
  14. In the previous example, <span class="command"><strong>int6k</strong></span> will send and receive frames on interface <code class="varname">eth3</code> 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 <code class="constant">PLC</code> to your preferred Ethernet interfaces, as follows:
  15. </p><div class="example"><a name="idp22250088"></a><p class="title"><b>Example 5.2. 
  16. Changing the Default Interface on Linux
  17. </b></p><div class="example-contents"><pre class="screen">
  18. # export PLC="eth2"
  19. </pre></div></div><br class="example-break"><p>
  20. In the previous example, environment variable <code class="constant">PLC</code> is defined and exported, making it available to all programs running under the current console session. This command can be included in <code class="filename">~/.profile</code> or <code class="filename">/etc/profile</code> or in <code class="filename">/etc/environment</code> on <span class="productname">Debian </span>™ and <span class="productname">Ubuntu</span>™ systems.
  21. </p><div class="example"><a name="idp22253304"></a><p class="title"><b>Example 5.3. 
  22. Finding Interfaces on Linux
  23. </b></p><div class="example-contents"><pre class="screen">
  24. # ifconfig
  25. eth0 Link encap:Ethernet HWaddr 00:60:97:05:97:0C
  26. inet addr:192.168.170.179 Bcast:192.168.170.255 Mask:255.255.255.0
  27. inet6 addr: fe80::260:97ff:fe05:970c/64 Scope:Link
  28. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  29. RX packets:52130758 errors:0 dropped:0 overruns:0 frame:0
  30. TX packets:59629414 errors:0 dropped:0 overruns:0 carrier:0
  31. collisions:0 txqueuelen:1000
  32. RX bytes:43781526 (41.7 MiB) TX bytes:4226651392 (3.9 GiB)
  33. Interrupt:209 Base address:0xe000
  34. eth1 Link encap:Ethernet HWaddr 00:0F:EA:10:D5:1C
  35. inet addr:192.168.99.1 Bcast:192.168.99.255 Mask:255.255.255.0
  36. inet6 addr: fe80::20f:eaff:fe10:d51c/64 Scope:Link
  37. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  38. RX packets:68711621 errors:0 dropped:0 overruns:0 frame:0
  39. TX packets:70059644 errors:0 dropped:0 overruns:0 carrier:0
  40. collisions:0 txqueuelen:1000
  41. RX bytes:3449044517 (3.2 GiB) TX bytes:1328494982 (1.2 GiB)
  42. Interrupt:217
  43. lo Link encap:Local Loopback
  44. inet addr:127.0.0.1 Mask:255.0.0.0
  45. inet6 addr: ::1/128 Scope:Host
  46. UP LOOPBACK RUNNING MTU:16436 Metric:1
  47. RX packets:177789 errors:0 dropped:0 overruns:0 frame:0
  48. TX packets:177789 errors:0 dropped:0 overruns:0 carrier:0
  49. collisions:0 txqueuelen:0
  50. RX bytes:599522176 (571.7 MiB) TX bytes:599522176 (571.7 MiB)
  51. </pre></div></div><br class="example-break"><p>
  52. The previous example demonstrates the use of Linux <span class="application">ifconfig</span> utility to identify available network interfaces by name and <acronym class="acronym">MAC</acronym> address.
  53. </p><p>
  54. 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 <code class="constant">PLC</code> in each enviroment.
  55. </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch05.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 5. 
  56. Procedures
  57.  </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
  58. Select an Interface on Windows
  59. </td></tr></table></div></body></html>