⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setting_up_the_network.html

📁 ADI 公司blackfin系列的用户使用文挡。
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head>  <title></title>  <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />  <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />  <link rel="stylesheet" media="print" type="text/css" href="./print.css" />  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="level1"><div class="li"><span class="li"><a href="#setting_up_the_network" class="toc">Setting up the Network</a></span></div><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#automatic_network_setup" class="toc">Automatic Network Setup</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#manual_network_setup" class="toc">Manual Network Setup</a></span></div><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#configuring_a_network_interface" class="toc">Configuring a network interface</a></span></div></li></ul></li><li class="level2"><div class="li"><span class="li"><a href="#troubleshooting_network_problems" class="toc">Troubleshooting network problems</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#more_information" class="toc">More information</a></span></div></li></ul></li></ul></div></div><h1><a name="setting_up_the_network" id="setting_up_the_network">Setting up the Network</a></h1><div class="level1"><p> There are two basic ways to set up the network - automatically, and manually.</p></div><!-- SECTION [1-117] --><h2><a name="automatic_network_setup" id="automatic_network_setup">Automatic Network Setup</a></h2><div class="level2"><p> To set things up automatically, normally requires the use of Dynamic Host Configuration Protocol (dhcp). It is used to control networking parameters of hosts (running clients) with the help of a server. This requires that someone has set up a dhcp server on your network, and has it configured properly. If this describes your condition, then you can read further details about the <a href="dhcpcd.html" class="wikilink1" title="dhcpcd.html">dhcpcd</a> client.</p></div><!-- SECTION [118-556] --><h2><a name="manual_network_setup" id="manual_network_setup">Manual Network Setup</a></h2><div class="level2"><p> If you are unfamiliar with Linux Networking, or IP networks in general, it would be a good idea to read some information to review some topics:</p><ul><li class="level1"><div class="li"> <a href="http://www.tldp.org/HOWTO/NET3-4-HOWTO-5.html#ss5.1" class="urlextern" title="http://www.tldp.org/HOWTO/NET3-4-HOWTO-5.html#ss5.1"  rel="nofollow">Basic Networking</a></div></li></ul></div><!-- SECTION [557-813] --><h3><a name="configuring_a_network_interface" id="configuring_a_network_interface">Configuring a network interface</a></h3><div class="level3"><p>When you have all of the information you need, you can start to configure your network interfaces. This is process of assigning appropriate addresses to a network device and to setting appropriate values for other configurable parameters of a network device. </p><ol><li class="level1"><div class="li"> Set the IP number, and netmask:<pre class="code">root:~&gt; ifconfig eth0 10.64.204.245 netmask 255.255.255.0 up</pre><p>In this case the interface <code>eth0</code> is configured with the IP address <code>10.64.204.245</code> and a network mask of <code>255.255.255.0</code>. The <code>up</code> that trails the command tells the interface that it should become active. To shutdown an interface, you can just call <code>ifconfig eth0 down</code>. </p></div></li><li class="level1"><div class="li"> Check to make sure it was set properly:<pre class="code">root:~&gt; ifconfig eth0eth0      Link encap:Ethernet  HWaddr 00:E0:22:FE:47:33          inet addr:10.64.204.245  Bcast:10.64.204.255  Mask:255.255.255.0          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:17 errors:0 dropped:0 overruns:0 frame:0          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000</pre><p><code>ifconfig</code> has many options, which are described in <a href="ifconfig.html" class="wikilink1" title="ifconfig.html">ifconfig</a>.</p></div></li><li class="level1"><div class="li"> Now, the default gateway must be set to tell the kernel networking code, how to talk to other IP addresses, not on the same subnet.<pre class="code">root:~&gt; routeKernel IP routing tableDestination    Gateway        Genmask        Flags Metric Ref    Use Iface10.64.204.0    *              255.255.255.0  U    0      0        0 eth0</pre><p>Here we can tell there is no default gateway. To add this:</p><pre class="code">root:~&gt; route add default gw 10.64.204.1root:~&gt; routeKernel IP routing tableDestination    Gateway        Genmask        Flags Metric Ref    Use Iface10.64.204.0    *              255.255.255.0  U    0      0        0 eth0default        10.64.204.1    0.0.0.0        UG    0      0        0 eth0</pre><p>Now, we can check to make sure that traffic can come to/from other subnets (Note that the IP number we are pinging is not on the same subnet we are):</p><pre class="code">root:~&gt; ping -c 3 10.64.53.110PING 10.64.53.110 (10.64.53.110): 56 data bytes64 bytes from 10.64.53.110: icmp_seq=0 ttl=124 time=0.8 ms64 bytes from 10.64.53.110: icmp_seq=1 ttl=124 time=0.7 ms64 bytes from 10.64.53.110: icmp_seq=2 ttl=124 time=0.7 ms--- 10.64.53.110 ping statistics ---3 packets transmitted, 3 packets received, 0% packet lossround-trip min/avg/max = 0.7/0.7/0.8 ms</pre></div></li><li class="level1"><div class="li"> At this point, the ethernet device is configured, but there is no way for you to do name lookups, to translate names, like <code><a href="http://www.google.com" class="urlextern" title="http://www.google.com"  rel="nofollow">www.google.com</a></code> to IP addresses. To do this, the name Resolver must be set, in <code>/etc/resolv.conf</code>:<pre class="code">root:~&gt; cat /etc/resolv.confsearch ad.analog.comnameserver 10.64.53.110nameserver 10.64.51.110nameserver 10.66.5.110nameserver 10.64.82.11root:~&gt; nslookup www.google.comServer:    nwd2dc2.ad.analog.comAddress:    10.64.53.110Name:      www.l.google.comAddress:    64.233.161.147</pre></div></li></ol><p> There are many other things that should be done before a complete network is set up, but this should be the basics, and allow most people to continue.</p><p><a href="dhcpcd.html" class="wikilink1" title="dhcpcd.html">dhcpcd</a></p></div><!-- SECTION [814-4204] --><h2><a name="troubleshooting_network_problems" id="troubleshooting_network_problems">Troubleshooting network problems</a></h2><div class="level2"><p> There are many common network issues, which can be resolved numerous ways. Below are a few: </p><ul><li class="level1"><div class="li"> check you have the proper IP number:<pre class="code">root:~&gt; ifconfig eth0eth0      Link encap:Ethernet  HWaddr 00:E0:22:FE:47:33          inet addr:10.64.204.116  Bcast:10.64.204.255  Mask:255.255.255.0          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:692 errors:0 dropped:0 overruns:0 frame:0          TX packets:137 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000</pre><p>Other things to check are the MAC address - (<code>HWaddr</code>) - it should match the sticker on your hardware.</p></div></li><li class="level1"><div class="li"> check the default routing table:<pre class="code">root:~&gt; routeKernel IP routing tableDestination    Gateway        Genmask        Flags Metric Ref    Use Iface10.64.204.0    *              255.255.255.0  U    0      0        0 eth0default        10.64.204.1    0.0.0.0        UG    0      0        0 eth0</pre><p>It should include a <code>default</code> gateway - make sure you can ping it.</p></div></li><li class="level1"><div class="li"> Check <code>nslookup</code> to make sure that <acronym title="Domain Name Server">DNS</acronym> is working.<pre class="code">root:~&gt; nslookup www.analog.comServer:    nwd2dc2.ad.analog.comAddress:    10.64.53.110Name:      nwd2www1.analog.comAddress:    137.71.25.68</pre></div></li><li class="level1"><div class="li"> Check the network path with <code>traceroute</code>:<pre class="code">root:~&gt; traceroute www.analog.comtraceroute to nwd2www1.analog.com (137.71.25.68), 30 hops max, 40 byte packets1  10.64.204.1 (10.64.204.1)  1.903 ms  1.441 ms  1.242 ms2  10.64.1.77 (10.64.1.77)  1.675 ms  1.34 ms  -4.614 ms3  10.64.1.45 (10.64.1.45)  1.832 ms  1.537 ms  1.312 ms4  10.64.2.81 (10.64.2.81)  1.934 ms  1.612 ms  1.392 ms5  10.64.2.68 (10.64.2.68)  2.958 ms  2.699 ms  2.687 ms6  137.71.25.8 (137.71.25.8)  -2.119 ms  -2.244 ms  3.53 ms</pre><p>Note: traceroute uses IMCP (ping), so things that block ping (like firewalls), will stop traceroute from working, and you will end up with something like:</p><pre class="code">root:~&gt; traceroute www.google.comtraceroute to www.l.google.com (216.239.37.99), 30 hops max, 40 byte packets1  10.64.204.1 (10.64.204.1)  1.808 ms  -4.478 ms  1.251 ms2  10.64.1.77 (10.64.1.77)  1.679 ms  1.369 ms  -4.592 ms3  10.64.1.45 (10.64.1.45)  2.114 ms  1.678 ms  1.34 ms4  10.64.2.81 (10.64.2.81)  1.752 ms  1.592 ms  1.41 ms5  * * *6  * * *7  * * *</pre></div></li><li class="level1"><div class="li"> try <code>wget</code><pre class="code">root:~&gt; wget http://www.google.com/index.htmlConnecting to www.google.com[216.239.37.99]:80index.html          100% |*****************************|  2445      00:00 ETA</pre><p>If this works - you are pretty much set.</p></div></li></ul></div><!-- SECTION [4205-6792] --><h2><a name="more_information" id="more_information">More information</a></h2><div class="level2"><ul><li class="level1"><div class="li"> <a href="http://www.tldp.org/HOWTO/NET3-4-HOWTO.html" class="urlextern" title="http://www.tldp.org/HOWTO/NET3-4-HOWTO.html"  rel="nofollow">Linux Networking-HOWTO</a></div></li></ul></div><!-- SECTION [6793-] --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -