Moxa Technologies UC-7110 NAT Example, # iptables -A Input -i eth0 -p tcp --dport 25 -j LOG

Page 39

UC-7110 Series User’s Manual

Configuring UC-7110

Append or delete rules:

Usage:

#iptables [-t table] [-AI] [INPUT, OUTPUT, FORWARD] [-io interface] [-p tcp, udp, icmp, all] [-s IP/network] [--sport ports] [-d IP/network] [--dport ports] –j [ACCEPT. DROP]

-A:

Append one or more rules to the end of the selected chain.

-I:

Insert one or more rules in the selected chain as the given rule number.

-i:

Name of an interface via which a packet is going to be received.

-o:

Name of an interface via which a packet is going to be sent.

-p:

The protocol of the rule or of the packet to check.

-s:

Source address (network name, host name, network IP address, or plain IP

 

address).

--sport:

Source port number.

-d:

Destination address.

--dport:

Destination port number.

-j:

Jump target. Specifies the target of the rules; i.e., how to handle matched packets.

 

For example, ACCEPT the packet, DROP the packet, or LOG the packet.

Examples:

Example 1: Accept all packets from lo interface.

# iptables –A INPUT –i lo –j ACCEPT

Example 2: Accept TCP packets from 192.168.0.1.

# iptables –A INPUT –i eth0 –p tcp –s 192.168.0.1 –j ACCEPT

Example 3: Accept TCP packets from Class C network 192.168.1.0/24.

# iptables –A INPUT –i eth0 –p tcp –s 192.168.1.0/24 –j ACCEPT

Example 4: Drop TCP packets from 192.168.1.25.

# iptables –A INPUT –i eth0 –p tcp –s 192.168.1.25 –j DROP

Example 5: Drop TCP packets addressed for port 21.

# iptables –A INPUT –i eth0 –p tcp --dport 21 –j DROP

Example 6: Accept TCP packets from 192.168.0.24 to UC-7110’s port 137, 138, 139

# iptables –A INPUT –i eth0 –p tcp –s 192.168.0.24 --dport 137:139 –j ACCEPT

Example 7: Log TCP packets that visit UC-7110’s port 25.

# iptables –A INPUT –i eth0 –p tcp --dport 25 –j LOG

Example 8: Drop all packets from MAC address 01:02:03:04:05:06.

# iptables –A INPUT –i eth0 –p all –m mac –mac-source 01:02:03:04:05:06 –j DROP

NAT

NAT (Network Address Translation) protocol translates IP addresses used on one network into different IP addresses used on another network. One network is designated the inside network and the other is the outside network. Typically, UC-7110 connects several devices on a network and maps local inside network addresses to one or more global outside IP addresses, and un-maps the global IP addresses on incoming packets back into local IP addresses.

NOTE Click on the following link for more information about iptables and NAT:

http://www.netfilter.org/documentation/HOWTO/NAT-HOWTO.html

NAT Example

The IP address of all packets leaving LAN1 are changed to 192.168.3.127 (you will need to load

4-7

Image 39
Contents Second Edition, July UC-7110 Series User’s ManualCopyright Notice Table of Contents Chapter UC-7110 Device API Introduction Package Checklist Product FeaturesOverview Hardware Specifications UC-7110-LX Product SpecificationsSoftware Specifications UC-7110-LX JFFS2 File System User Directory Read / WriteKernel, Root File System Read Only RS-232/422/485 Hardware Block DiagramAppearance EthernetDimensions UC-7110 Installing UC-7110Wiring Requirements LED IndicatorsGrounding UC-7110 Connecting Data Transmission CablesConnecting the Power Connecting to the NetworkSerial Console Port Connecting to a Serial DeviceAdditional Functions Reset ButtonReal Time Clock Getting Started Powering on UC-7110 Connecting UC-7110 to a PCConsole Port 192.168.3.127 255.255.255.0 Default IP Address Default NetmaskLogin root Password root TelnetIfconfig eth0 192.168.3.127 ifconfig eth1 Configuring the Ethernet InterfaceIfconfig eth0 #mount /dev/cdrom /mnt/cdrom Installing the UC-7110 Tool ChainDeveloping Your Applications StepCompiling Hello.c PATH=/usr/local/arm-elf/bin$PATH#make #ftp Ftp cd /home Ftp bin Ftp put ./hello Ftp quit #telnet Uploading Hello to UC-7110Running Hello on UC-7110 # chmod 755 hello #./hello# df -k or # df Suffixes Make File Example CodeUC-7110 Series User’s Manual Software Package UC-7110 Software Architecture Read-Only File System Romfs Journaling Flash File System JFFS2Additional information about Romfs is available at Additional information about JFFS2 is available at UC-7110 Software PackageUC-7110 Series User’s Manual Software Package ‰ Iptables ‰ NAT Configuring UC-7110Example default enable Enabling and Disabling DaemonsInetd Iptables Adding a WebSub-tables Local Host Packets Examples Usage# iptables -A Input -i eth0 -p tcp --dport 25 -j LOG NAT ExamplePppd connect ‘chat -v’ /dev/ttyM0 38400 crtscts Configuring Dial-in/Dial-out ServiceEnabling NAT at Bootup Dial-out ServiceIfconfig ppp0 Configuring PPPoEHow to Mount a Remote NFS Server Dial-in ServiceUpramdisk Ramdiskftp destination PC’s IP Login Name Login PasswordUpgrading the Kernel & Root File System Home/usr 192.168.3.1 rw,norootsquash,noallsquashRamdiskupkernel uc7110-1.3.11.bin /ramdiskreboot Upgrading the User DirectoryFtp bin Ftp get uc7110-1.x.x.bin Upramdisk Cd ramdisk Ramdiskbackupfs /ramdisk/usrdisk-backup User Directory Backup-UC-7110 to PCChecking the Kernel and User Directory Versions Loading Factory DefaultsMirroring the Application Program and Configuration How to Autostart User Applications on BootupUC-7110 Device API RTC Real Time Clock BuzzerUart Interface UC Finder Windows UC Finder UC-7110 Series User’s Manual UC Finder UC-7110 Series User’s Manual UC Finder Linux ucfinder Editor System CommandsBusybox V0.60.4 µClinux normal command utility collection File managerMoxa Special Utilities NetworkProcess OtherSnmp Agent with MIB II & RS-232 Like Group Ip MIB Tcp MIB Udp MIB Snmp Agent with MIB II & RS-232 Like GroupRFC1317 RS-232 like group supported variables Rs232 MIB Snmp MIBAnswer 3 arm-elf-gcc -W1, -elf2flt FAQ for UC-7110UC-7110 Series User’s Manual FAQ for UC-7110 Service Information Following services are provided Moxa Internet ServicesMoxa Product † UC-7110 Serial Number Problem Report FormProduct Return Procedure

UC-7110 specifications

The Moxa Technologies UC-7110 is a powerful and versatile computing platform designed for industrial applications and IoT (Internet of Things) deployments. It represents a compelling solution for edge computing needs, with an emphasis on reliability, flexibility, and ease of integration. The UC-7110 offers a compact form factor, making it suitable for space-constrained environments while delivering robust performance.

One of the UC-7110's main features is its Intel Atom E3825 processor, which provides a balance of power efficiency and computational capability, ensuring it can handle the demands of data processing tasks at the edge. With 1GB of DDR3 RAM and support for up to 32GB of onboard eMMC storage, the UC-7110 can efficiently manage applications that require quick access to data without the need for extensive external storage devices.

The UC-7110 also stands out for its extensive connectivity options. It is equipped with multiple serial ports, digital input/output (DIO), USB ports, and Ethernet interfaces, allowing seamless integration with a wide range of industrial devices and protocols. This connectivity is crucial for real-time data acquisition and control in various industrial settings. The device also supports optional wireless communication modules, including LTE, Wi-Fi, and Bluetooth, enhancing its suitability for remote and mobile applications.

In terms of software capabilities, the UC-7110 operates on a Linux-based operating system, providing users with the flexibility to develop custom applications tailored to their specific needs. Moxa also provides the MXIO library, which simplifies the programming of input/output operations, making it easier for developers to create robust and responsive applications.

The UC-7110 is designed to endure harsh industrial environments, featuring wide operating temperature ranges from -40°C to 70°C and IP30-rated protection against dust and moisture. This ruggedness ensures reliable performance in challenging conditions, which is critical for industries such as manufacturing, transportation, and energy.

Additionally, the device supports various industrial protocols like Modbus, MQTT, and OPC UA, facilitating integration into existing systems and enabling efficient data communication across different platforms. This compatibility is vital for leveraging existing infrastructure while adopting modern IoT solutions.

In summary, the Moxa UC-7110 is a robust, versatile edge computing solution ideal for industrial IoT applications. Its combination of powerful processing, extensive connectivity options, software flexibility, and rugged design makes it a valuable asset for organizations seeking to enhance their operational efficiency and adapt to evolving technological demands. Whether in manufacturing, smart cities, or remote asset monitoring, the UC-7110 provides the necessary tools to unlock new possibilities in industrial connectivity and data management.