TS-72XX TS-Linux Networking
The main utilities for network configuration under Linux are:
- ifconfig: prints network settings and configures ethernet interfaces
- ifup: turns given network interface up
- ifdown: turns given network interface down
Entering “ifconfig” shows the current ethernet settings. These utilities require a network device as parameter. On Linux, the ethernet devices are generally named eth0, eth1, etc. Therefore, the command “ifup eth0” or “ifconfig eth0 up” brings up the on-board ethernet interface on TS-72XX SBCs.
To configure the network, you need to manage the proper configuration files. On TS-Linux systems, these files are located in the “/etc/sysconfig/” directory. By default, Linux systems on TS-72XX boards are configured to assign the IP 192.168.0.50 to the on-board ethernet interface.
To configure the network when booting to the TS-Linux image on the flash chip, the files in "/etc/sysconfig/" must be edited. Network interfaces are configured on a file per interface basis. The first Ethernet device, eth0, is controlled by the file /etc/sysconfig/ifcfg-eth0". An example of "ifcfg-eth0" is shown below:
DEVICE=eth0 #Name of ethernet interface IPADDR=192.168.0.50 #IP address of this ethernet interface NETMASK=255.255.255.0 #Used with NETWORK to determine local IPs NETWORK=192.168.0.0 #Used with NETMASK to determine local IPs BROADCAST=192.168.0.255 #Broadcast IP for system wide messages BOOTPROTO=static #Static IP (change "static" to “DHCP”) ENABLE=yes #Load device on boot
The TCP/IP network settings are configured in the file '/etc/sysconfig/network_cfg':
NETWORKING=yes #Enable networking on startup GATEWAY="192.168.0.1" #Gateway for internet access GW_DEV=eth0 #Default gateway HOSTNAME=ts7200 #Host name of this computer BOOTPROTO=no FORWARD_IPV4=no DEFRAG_IPV4=no
The TCP/IP name resolution server is configured in '/etc/resolv.conf':
nameserver 192.168.0.1 #Name server for domain name lookups
Those lines starting with a # symbol are comments. As the above example shows, eth0 is given the static address of 192.168.0.50. If one wishes eth0 to obtain its IP from a DHCP server, then change the line BOOTPROTO=static to BOOTPROTO=dhcp. In order to test the default network settings with TS-Linux, open a web browser and use the embedded Apache web server by entering the default IP 192.168.0.50, or simple "ping" or "telnet" to 192.168.0.50.