DA-681 Linux
Managing Communications
3-3
Dynamic IP Address using DHCP
To configure one or both LAN ports to request an IP address dynamically, replace
static
with
dhcp
and then
delete the rest of the lines.
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
After modifying the boot settings of the LAN interface, issue the following command to activate the LAN settings
immediately.
# /etc/init.d/networking restart
MOXA:~# /etc/init.d/networking restart
Adjusting IP Addresses with “ifconfig”
IP settings can be adjusted during run-time, but the new settings will not be saved to the flash ROM without
modifying the file
/etc/network/interfaces
. For example, type the command
# ifconfig eth1
192.168.1.1
to change the IP address of LAN1 to 192.168.1.1.
MOXA:~# ifconfig eth1 192.168.1.1
MOXA:~#
Telnet Server
In addition to supporting Telnet client/server, the DA-681-LX also supports SSH and sftp client/server. To
enable or disable the Telnet server, you need to edit the file
/etc/inetd.conf
.
1.
Mount the root file system with write permission.
MOXA:~# mount -o remount,rw /dev/hda1 /
2.
Type
# cd /etc
to change the directory.
MOXA:~# cd /etc
3.
Type
# vi inetd.conf
to edit the configuration file.
MOXA:/etc# vi inetd.conf
Enabling the Telnet Server
The following example shows the default content of the file
/etc/inetd.conf
. The default is to “enable the
Telnet/ftp server:”
discard dgram udp wait root /bin/discard
discard stream tcp nowait root /bin/discard
telnet stream tcp nowait root /bin/telnetd