Difference between revisions of "Network Configuration"
Kyoungmeyer (talk | contribs) |
|||
(12 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | {{todo| | + | {{todo|SEOKWREV (11.25.13-16:00->KY+);(11.26.13-19:30->MD+);(12.20.13-11:05->MW+);(03.04.14-15:30->BS-);(03.14.14-16:15->BS-);(03.17.14-15:20->BS+)|Klint Youngmeyer|project=oe 4,oe 5,ky,SEOKWREV,md,mw,bs}} |
− | Linux is built with extensive networking capability, making it an ideal choice for a server. EMAC OE Linux includes a large range of networking options. Reliable network connections can be made easily and | + | {{#seo: |
+ | |title=Network Configuration | ||
+ | |titlemode=append | ||
+ | |keywords=Network Configuration,Network Interface Settings,Static Network Configuration,Disabling Telnet,Linux | ||
+ | |description=Process of configuring a basic network connection with EMAC boards. | ||
+ | }} | ||
+ | Linux is built with extensive networking capability, making it an ideal choice for a server. EMAC OE Linux includes a large range of networking options. Reliable network connections can be made easily, and many configuration options are available to suit the user's needs. | ||
− | Network configuration is handled dynamically using a daemon called <code>ifplugd</code>, which manages automatic configuration of network connections based on the connection state. <code>ifplugd</code> automatically calls <code>ifup</code> to bring up the network interface when a link is detected and <code>ifdown</code> to deconfigure the interface when a network link is lost. Network configuration options are read from the file <code>/etc/network/interfaces</code> by <code>ifup</code> and <code>ifdown</code>. As with most Linux systems, the default network interface is named eth0 unless otherwise noted for a particular hardware combination. | + | Network configuration is handled dynamically using a daemon called <code>ifplugd</code>, which manages automatic configuration of network connections based on the connection state. <code>ifplugd</code> automatically calls <code>ifup</code> to bring up the network interface when a link is detected and <code>ifdown</code> to deconfigure the interface when a network link is lost.. Network configuration options are read from the file <code>/etc/network/interfaces</code> by <code>ifup</code> and <code>ifdown</code>. As with most Linux systems, the default network interface is named eth0 unless otherwise noted for a particular hardware combination. |
__TOC__ | __TOC__ | ||
== Network Interface Settings == | == Network Interface Settings == | ||
+ | |||
The <code>/etc/network/interfaces</code> file holds the configuration settings for all interfaces on the system. Modify this file to change the way the system connects to the network. For information on how to edit a file directly on an EMAC OE system, please see [[Editing_a_File | this page.]] Each physical interface may be configured for static addressing or DHCP. On most systems, the default <code>/etc/network/interfaces</code> file looks like this: | The <code>/etc/network/interfaces</code> file holds the configuration settings for all interfaces on the system. Modify this file to change the way the system connects to the network. For information on how to edit a file directly on an EMAC OE system, please see [[Editing_a_File | this page.]] Each physical interface may be configured for static addressing or DHCP. On most systems, the default <code>/etc/network/interfaces</code> file looks like this: | ||
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) | # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) | ||
Line 19: | Line 26: | ||
=== Static Network Configuration === | === Static Network Configuration === | ||
− | Depending on the network | + | |
+ | Depending on the network the system will connect to, it may be necessary to configure the board to use a static IP address rather than to acquire one using DHCP. This can be done by editing the eth0 configuration entry in <code>/etc/network/interfaces</code>. The following settings may be used for this configuration: | ||
#<code>address</code>: The static IP address. | #<code>address</code>: The static IP address. | ||
#<code>netmask</code>: The subnetwork mask. | #<code>netmask</code>: The subnetwork mask. | ||
Line 47: | Line 55: | ||
Telnet comes enabled by default for easy initial access but should be disabled when practical, as it is extremely insecure. EMAC recommends using SSH for all network sessions, particularly if the system is open to the Internet. | Telnet comes enabled by default for easy initial access but should be disabled when practical, as it is extremely insecure. EMAC recommends using SSH for all network sessions, particularly if the system is open to the Internet. | ||
− | To disable the Telnet server, comment out the directive in the | + | To disable the Telnet server, comment out the directive in the <code>/etc/inetd.conf</code> configuration file as in the example below. Note that this setting will not take effect until the system is rebooted or the <code>inetd</code> server is manually restarted. |
#:STANDARD: These are standard services. | #:STANDARD: These are standard services. | ||
ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/ftpd | ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/ftpd | ||
Line 54: | Line 62: | ||
==Next Steps== | ==Next Steps== | ||
Now that your EMAC OE system is set up, it is time to begin [[EMAC_OE_Development_Process | software development.]] | Now that your EMAC OE system is set up, it is time to begin [[EMAC_OE_Development_Process | software development.]] | ||
− | + | <!-- | |
[[Category:Linux]] | [[Category:Linux]] | ||
[[Category:OpenEmbedded]] | [[Category:OpenEmbedded]] | ||
+ | --> |
Latest revision as of 14:23, 17 March 2014
Linux is built with extensive networking capability, making it an ideal choice for a server. EMAC OE Linux includes a large range of networking options. Reliable network connections can be made easily, and many configuration options are available to suit the user's needs.
Network configuration is handled dynamically using a daemon called ifplugd
, which manages automatic configuration of network connections based on the connection state. ifplugd
automatically calls ifup
to bring up the network interface when a link is detected and ifdown
to deconfigure the interface when a network link is lost.. Network configuration options are read from the file /etc/network/interfaces
by ifup
and ifdown
. As with most Linux systems, the default network interface is named eth0 unless otherwise noted for a particular hardware combination.
Contents
Network Interface Settings
The /etc/network/interfaces
file holds the configuration settings for all interfaces on the system. Modify this file to change the way the system connects to the network. For information on how to edit a file directly on an EMAC OE system, please see this page. Each physical interface may be configured for static addressing or DHCP. On most systems, the default /etc/network/interfaces
file looks like this:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) # The loopback interface auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet dhcp
Depending on the hardware, there may be additional entries for other interfaces, such as a second Ethernet interface or wireless connection. The first entry for the interface named "lo" is the local loopback interface -- a virtual network interface for local communication. The "eth0" entry controls the settings for the first network interface. The first line: allow-hotplug eth0
indicates that the connection should be managed dynamically by ifplugd
and not automatically brought up by the system (as it would if the line read auto eth0
). The second line iface eth0 inet dhcp
indicates that the interface should be configured by DHCP.
Static Network Configuration
Depending on the network the system will connect to, it may be necessary to configure the board to use a static IP address rather than to acquire one using DHCP. This can be done by editing the eth0 configuration entry in /etc/network/interfaces
. The following settings may be used for this configuration:
address
: The static IP address.netmask
: The subnetwork mask.broadcast
: The broadcast address (generally not required).gateway
: The default gateway.
An example of a valid static network configuration for eth0 is shown below:
allow-hotplug eth0 iface eth0 inet static address 10.0.2.41 netmask 255.255.255.0 gateway 10.0.2.1
Once the static IP configuration has been set, the Domain Name System (DNS) resolver configuration should also be changed to match the network that the system is on. When the system is set to DHCP, this information is set automatically by the DHCP client. The resolver configuration is stored in the file /etc/resolv.conf
. Because /etc/resolv.conf
must be volatile to allow the DHCP client to make changes while the root filesystem is read-only, it is a symbolic link to the file /var/run/resolv.conf
, which is stored in a ramdisk. On each system boot, the networking initialization script copies the contents of the default configuration /etc/default/resolv.conf
to /var/run/resolv.conf
. To make persistent changes to the static resolver configuration, edit /etc/default/resolv.conf
directly.
The resolver configuration generally consists of one to three nameserver entries and a domain entry, though other options may be specified (see resolv.conf man page for more information). The example below shows a valid configuration:
nameserver 10.0.2.1 domain emacinc.com
Changes made to /etc/default/resolv.conf will not be applied automatically until the next system boot. To apply the changes without rebooting, copy the configuration to /var/run/resolv.conf : emac-oe:~# cp /etc/default/resolv.conf /var/run/resolv.conf |
Disabling Telnet
Telnet comes enabled by default for easy initial access but should be disabled when practical, as it is extremely insecure. EMAC recommends using SSH for all network sessions, particularly if the system is open to the Internet.
To disable the Telnet server, comment out the directive in the /etc/inetd.conf
configuration file as in the example below. Note that this setting will not take effect until the system is rebooted or the inetd
server is manually restarted.
#:STANDARD: These are standard services. ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/ftpd #telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/telnetd
Next Steps
Now that your EMAC OE system is set up, it is time to begin software development.