Moxa V2101-T-LX Руководство по программной части (Linux) онлайн

V2101 Series Linux User’s Manual
Second Edition, November 2013
www.moxa.com/product
© 2009 Moxa Inc. All rights reserved.
Содержание
- Second edition november 2013 1
- V2101 series linux user s manual 1
- Www moxa com product 1
- Copyright notice 2
- Disclaimer 2
- Technical support contact information 2
- Trademarks 2
- V2101 series linux user s manual 2
- Www moxa com support 2
- Table of contents 3
- Introduction 5
- Attention 6
- Overview 6
- Software specifications 6
- V2101 series linux introduction 6
- Attention 7
- Software components 7
- V2101 series linux introduction 7
- V2101 series linux introduction 8
- V2101 series linux introduction 9
- V2101 series linux introduction 10
- V2101 series linux introduction 11
- V2101 series linux introduction 12
- V2101 series linux introduction 13
- V2101 series linux introduction 14
- V2101 series linux introduction 15
- V2101 series linux introduction 16
- V2101 series linux introduction 17
- V2101 series linux introduction 18
- V2101 series linux introduction 19
- V2101 series linux introduction 20
- V2101 series linux introduction 21
- V2101 series linux introduction 22
- V2101 series linux introduction 23
- V2101 series linux introduction 24
- Software configuration 25
- Connecting from a telnet console 26
- Moxa login root password last login mon jan 22 19 02 16 2007 from 192 68 20 for further information check http www moxa com mount user file system moxa 26
- Starting from a vga console 26
- V2101 series linux software configuration 26
- Connecting from an ssh console 27
- V2101 series linux software configuration 27
- Windows users 27
- Adjusting the system time 28
- Linux users 28
- Moxa date wed dec 16 03 34 46 cst 2009 moxa hwclock wed 16 dec 2009 03 35 16 am cst 0 17600 seconds moxa date 121616352009 wed dec 16 16 35 00 cst 2009 moxa hwclock w moxa date hwclock wed dec 16 16 36 12 cst 2009 wed 16 dec 2009 03 38 13 am cst 0 16751 seconds moxa 28
- Ntp client 28
- Root bee_notebook root ssh 192 68 27 the authenticity of host 192 68 27 192 68 27 can t be established rsa key fingerprint is 8b ee ff 84 41 25 fc cd 2a f2 92 8f cb 1f 6b 2f are you sure you want to continue connection yes no yes_ 28
- Setting the time manually 28
- V2101 series linux software configuration 28
- Attention 29
- Example shell script for updating the system time periodically 29
- How to run the shell script automatically when the kernel boots up 29
- Updating the time automatically 29
- Enabling and disabling daemons 30
- V2101 series linux software configuration 30
- Setting the run level 32
- Cron daemon for executing scheduled commands 33
- Minute hour date month week user command 8 root path to your program 33
- Moxa cd etc rc2 d moxa etc rc2 d moxa etc rc2 d ls s19nfs common s25nfs user server s99showreadyled 33
- Moxa etc rc2 d 33
- Moxa etc rc2 d moxa etc rc2 d ln s root tcps2 release s60tcps2 moxa etc rc2 d ls s19nfs common s25nfs user server s99rmnologin 33
- Moxa rm f etc rc2 d s60tcps2 33
- Moxa umount 33
- S20snmpd s55ssh 33
- S20snmpd s55ssh s99showreadyled 33
- S24pcmcia s60tcps2 33
- S24pcmcia s99rmnologin 33
- V2101 series linux software configuration 33
- Attention 34
- Inserting a usb storage device into the computer 34
- Moxa mount dev hda1 on type ext2 rw errors remount ro tmpfs on lib init rw type tmpfs rw nosuid mode 0755 proc on proc type proc rw noexec nosuid nodev sysfs on sys type sysfs rw noexec nosuid nodev procbususb on proc bus usb type usbfs rw udev on dev type tmpfs rw mode 0755 tmpfs on dev shm type tmpfs rw nosuid nodev devpts on dev pts type devpts rw noexec nosuid gid 5 mode 620 dev hdb2 on home type ext2 rw nfsd on proc fs nfsd type nfsd rw rpc_pipefs on var lib nfs rpc_pipefs type rpc_pipefs rw dev sda1 on media usb0 type vfat rw noexec nodev sync noatime gid 25 dmask 0007 fmask 0117 dev sdb1 on media usb1 type vfat rw noexec nodev sync noatime gid 25 dmask 0007 fmask 0117 moxa 34
- V2101 series linux software configuration 34
- Vga lvds configuration 34
- Moxa mount o remount rw moxa vi etc x11 xorg conf section screen identifier screen0 device intel_iegd 0 monitor monitor0 subsection display modes 1024x768 endsubsection endsection 35
- Moxa vi etc x11 xorg conf moxa moxa primary first only display section device identifier intel_iegd 0 driver iegd vendorname intel r deg boardname embedded graphics busid 0 2 0 screen 0 option pcfversion 1792 option configid 3 option all 7 name 10x6samsung option all 7 general portorder 24000 option all 7 general displayconfig 2 option all 7 general displaydetect 1 option all 7 port 2 general name sdvo option all 7 port 2 general edidavail 3 option all 7 port 2 general edidnotavail 1 option all 7 port 2 general rotation 0 35
- V2101 series linux software configuration 35
- Moxa startx 36
- V2101 series linux software configuration 36
- Apt installing and removing packages 38
- Attention 38
- Checking the linux version 38
- Moxa apt get install openswan moxa 38
- Moxa apt get update moxa 38
- Moxa mount o remount rw dev hda1 38
- Moxa uname a linux moxa 2 6 2 686 1 smp sun jul 26 21 25 33 utc 2009 i686 gnu linux moxa 38
- Moxa vi etc apt sources list moxa moxa deb cdrom debian gnu linux 5 a _lenny_ official i386 netinst binary 1 20 090817 16 43 lenny main deb cdrom debian gnu linux 5 a _lenny_ official i386 netinst binary 1 200 90817 16 43 lenny main deb http ftp us debian org debian lenny main deb src http ftp us debian org debian lenny main deb http security debian org lenny updates main contrib deb src http security debian org lenny updates main contrib deb http volatile debian org debian volatile lenny volatile main deb src http volatile debian org debian volatile lenny volatile main 38
- V2101 series linux software configuration 38
- Attention 39
- Moxa apt get clean moxa 39
- Moxa apt get remove openswan moxa 39
- Moxa apt get remove openswan purge moxa 39
- Moxa df h filesystem size used avail use mounted on rootfs 1 g 972m 560m 64 udev 10m 700k 9 m 7 dev dev hda1 1 g 972m 560m 64 tmpfs 502m 0 502m 0 lib init rw tmpfs 502m 0 502m 0 dev shm none 502m 19m 483m 4 tmp dev hda2 199m 125m 63m 67 home moxa 39
- Moxa umount moxa 39
- V2101 series linux software configuration 39
- Managing communications 40
- Attention 41
- Configuring a persistent network interface naming order 41
- Configuring network interfaces 41
- Dynamic ip address using dhcp 42
- Etc networ 42
- Etc network interfaces 42
- Etc network sudo vi interfaces 42
- Etc networking interface 42
- Ethernet interface configuration 42
- Static ip address 42
- Sudo service networking restart 42
- The loopback network interface auto lo iface lo inet loopback the primary network interface auto eth0 iface eth0 inet dhcp address 192 68 27 netmask 255 55 55 broadcast 192 68 55 42
- The loopback network interface auto lo iface lo inet loopback the primary network interface auto eth0 iface eth0 inet static address 192 68 27 netmask 255 55 55 broadcast 192 68 55 auto eth1 iface eth1 inet static address 192 68 27 netmask 255 55 55 broadcast 192 68 55 42
- V2101 series linux managing communications 42
- Adjusting ip addresses with ifconfig 43
- Etc network interface 43
- Point to point over ethernet pppoe config 43
- Pppoeconf 43
- Sudo ifconfig eth0 192 68 43
- The easy way pppoeconf 43
- V2101 series linux managing communications 43
- Etc resolve con 44
- V2101 series linux managing communications 44
- The difficult way manually 45
- Attention 46
- Cat etc resolv conf resolv conf this file is the resolver configuration file see resolver 5 nameserver 168 5 nameserver 139 75 0 0 etc 46
- Configuring a point to point connection 46
- Inet addr 192 6 2 p t p 129 7 65 mask 255 55 55 inet addr 192 6 2 p t p 129 7 65 mask 255 55 55 46
- Moxa moxa ifconfig ppp 46
- Moxa moxa kill 9 pppd 46
- Moxa moxa pppd eth0 46
- Nameserver 168 5 nameserver 139 75 0 0 46
- Nameserver ip_addr_of_first_dns_server nameserver ip_addr_of_second_dns_server 46
- Ppp0 link encap point to point protocol 46
- Rx packets 33 errors 0 dropped 0 overrun 0 rx packets 33 errors 0 dropped 0 overrun 0 46
- Tx packets 42 errors 0 dropped 0 overrun 0 tx packets 42 errors 0 dropped 0 overrun 0 46
- Up pointopoint running mtu 1500 metric 1 up pointopoint running mtu 1500 metric 1 46
- V2101 series linux managing communications 46
- Connecting to a ppp server over a hardwired link 47
- Moxa moxa pppd connect chat v atdt5551212 connect login username password password dev ttym0 115200 debug crtscts modem defaultroute 192 7 47
- Moxa moxa pppd connect chat v atdt5551212 connect user username password password dev ttym0 115200 crtscts modem 47
- Moxa moxa pppd connect chat v noipdefault dev ttym0 19200 crtscts 47
- Moxa moxa pppd connect chat v user root password root noipdefault dev ttym0 19200 crtscts 47
- V2101 series linux managing communications 47
- Checking the connection 48
- Method 1 pppd dial in with pppd commands 49
- Method 2 pppd dial in with pppd script 49
- Setting up a machine for incoming ppp connections 49
- Attention 50
- Enabling a telnet ftp or tftp server 50
- Serial port operation mode 50
- Telnet ftp tftp server 50
- Configuring the dns resolver 51
- Configuring the os hostname 51
- Disabling a telnet ftp tftp server 51
- Dns utilities 51
- Etc hostnam 51
- Etc hostname 51
- Etc nsswitch con 51
- Etc resolv con 51
- Hostname your preferred hostname 51
- Moxa moxa ntpdate time stdtime gov tw 51
- Sudo etc init d hostname sh start 51
- Sudo service openbsd inetd restart 51
- Telnet stream tcp nowait telnetd usr sbin tcpd usr sbin in telnetd ftp stream tcp nowait root usr sbin tcpd usr sbin proftpd 51
- Tftp dgram udp wait nobody usr sbin tcpd usr sbin in tftpd srv tftp 51
- V2101 series linux managing communications 51
- Apache web server 52
- Configuring the name service switcher 52
- Etc cat resolv conf resolv conf this file is the resolver configuration file see resolver 5 nameserver 192 68 6 nameserver 140 15 1 nameserver 140 15 36 0 nameserver 168 5 52
- Etc nsswitch conf example configuration of gnu name service switch functionality if you have the glibc doc reference and info packages installed try info libc name service switch for information about this file passwd compat group compat shadow compat hosts files dns networks files protocols db files 52
- Resolv conf 52
- Services db files ethers db files rpc db files netgroup nis 52
- V2101 series linux managing communications 52
- Attention 53
- Configuring the common gateway interface cgi 53
- Default homepage 53
- Disabling cgi 53
- Etc apache2 sites enabled 000 defaul 53
- Http 192 68 27 53
- Http httpd apache org docs 2 howto cgi html 53
- Moxa moxa vi etc apache2 sites enabled 000 default 53
- Setting up cgi 53
- Sudo service apache2 restart 53
- Usr lib cgi bi 53
- V2101 series linux managing communications 53
- Var www cgi bi 53
- Var www index htm 53
- Attention 54
- Etc apache2 sites available defaul 54
- Etc sudo vi etc apache2 sites avaliable default 54
- Etc sudo vi etc apache2 sites avaliable default ssl 54
- Media usb 54
- Moxa moxa sudo mount 54
- Options followsymlinks 54
- Saving web pages to a usb storage device 54
- V2101 series linux managing communications 54
- Var ww 54
- Attention 55
- Moxa cd etc init d apache2 restart 55
- V2101 series linux managing communications 55
- Attention 56
- Building the firewall setting policies and writing rules 56
- Ip tables and ip chains 56
- Netfilter iptables 56
- Overview of basic netfilter architecture 56
- The filter table 57
- The five built in rule chains 57
- The mangle table 57
- The nat table 57
- Understanding rule chains 57
- V2101 series linux managing communications 57
- Attention 58
- Moxa moxa moxa iptables n tcp iptables n udp 58
- Understanding basic traffic flows 58
- User defined chains 58
- V2101 series linux managing communications 58
- Attention 59
- Netfilter hierarchy for incoming packets 59
- V2101 series linux managing communications 59
- Building the firewall 60
- Connection tracking 60
- Policies setting default firewall behavior 60
- Warning 60
- Attention 61
- Command arguments 61
- Moxa moxa moxa iptables p forward drop 61
- Moxa moxa moxa iptables p input drop 61
- Moxa moxa moxa iptables p output accept 61
- Moxa moxa moxa iptables t nat p output accept 61
- Moxa moxa moxa iptables t nat p prerouting accept 61
- Moxa moxa moxa iptables t tables p policy chain target policy accept drop etc 61
- Netfilter policy examples 61
- Policy arguments 61
- Setting policies 61
- V2101 series linux managing communications 61
- Etc iptables save 62
- Etc iptables save you may name the file whatever you wish 62
- Flush a current rule chain or delete a user specified chain 62
- List current rule chains for a target table or for all tables 62
- Moxa moxa moxa iptables t nat p postrouting accept 62
- Moxa moxa moxa iptables t table or multiple tables l chain n 62
- Moxa moxa moxa iptables t table or tables fxz 62
- Moxa moxa moxa moxa iptables 62
- Moxa moxa moxa moxa iptables restore etc iptables save 62
- V2101 series linux managing communications 62
- Viewing and manipulating rulesets 62
- Warning 62
- Delete a user generated chain 63
- Examples 63
- Moxa moxa iptables a input i lo j accept 63
- Moxa moxa iptables a input m conntrack ctstate related established j accept 63
- Moxa moxa moxa 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 63
- Moxa moxa moxa moxa iptables a input i lo j accept 63
- Moxa moxa moxa moxa iptables l z n chain rulenum 63
- Moxa moxa moxa moxa iptables x chain 63
- V2101 series linux managing communications 63
- Warning 63
- Writing rulechains 63
- Zero out the packet and byte counters for a rule chain 63
- Attention 64
- Etc modprobe conf 64
- Moxa moxa iptables a input i eth0 p all m mac mac source 01 02 03 04 05 06 j drop 64
- Moxa moxa iptables a input i eth0 p all m mac mac source 02 03 04 05 06 07 j accept 64
- Moxa moxa iptables a input i eth0 p tcp dport 21 j accept 64
- Moxa moxa iptables a input i eth0 p tcp dport 25 j log 64
- Moxa moxa iptables a input i eth0 p tcp s 192 68 24 j accept 64
- Moxa moxa iptables a input i eth0 p tcp s 192 68 4 dport 137 139 j accept 64
- Moxa moxa iptables a input i eth0 p tcp s 192 68 5 j drop 64
- Moxa moxa iptables a input i eth0 p tcp s 192 68 j accept 64
- Moxa moxa iptables a input m conntrack ctstate invalid j drop 64
- Moxa moxa iptables a input p 41 j accept 64
- Moxa moxa iptables a input p tcp dport 22 j accept 64
- Moxa moxa iptables a input p tcp dport 443 j accept 64
- Moxa moxa iptables a input p tcp dport 80 j accept 64
- Moxa moxa iptables a input p udp dport 53 j accept 64
- Moxa moxa modprobe ipt_mac 64
- Rule examples applying user defined chains 64
- V2101 series linux managing communications 64
- Attention 65
- Enabling nat masquerading 65
- Ip tables nat policies 65
- Moxa moxa iptables a input p udp m conntrack ctstate new j udp moxa moxa iptables a input p tcp syn m conntrack ctstate new j tcp 65
- Moxa moxa iptables a tcp p tcp dport 80 j accept moxa moxa iptables a tcp p tcp dport 443 j accept moxa moxa iptables a tcp p tcp dport 22 j accept moxa moxa iptables a udp p udp dport 53 j accept 65
- Moxa moxa iptables t nat p prerouting accept moxa moxa iptables t nat p postrouting accept moxa moxa iptables t nat p output accept 65
- Setting up nat network address translation 65
- Source nat snat and destination nat dnat 65
- V2101 series linux managing communications 65
- Attention 66
- Saving the firewall 66
- Setting up a networked file system nfs 66
- Attention 67
- Etc fsta 67
- Ethernet bridges linking indepdent subnets over the internet 67
- Moxa moxa mkdir p home nfs public 67
- Moxa moxa mount t nfs o nolock 192 68 home public home nfs public 67
- Moxa moxa openvpn genkey secret secrouter key 67
- Moxa moxa scp etc openvpn secrouter key xxx xxx x xxx etc openvpn 67
- Setting up a vpn 67
- V2101 series linux managing communications 67
- Attention 68
- Configuring openvpn a vpn server 68
- Configuring openvpn b vpn subnet client 69
- Etc openvpn tap0 br con 70
- Ethernet bridging for private networks on the same subnet 70
- Moxa moxa killall term openvpn 70
- Moxa moxa ping 192 68 74 70
- Moxa moxa route add net 192 68 netmask 255 55 55 dev eth0 70
- Point to the peer remote 192 68 74 dev tap0 secret etc openvpn secrouter key cipher des ede3 cbc auth md5 tun mtu 1500 tun mtu extra 64 70
- V2101 series linux managing communications 70
- Etc openvpn tun con 71
- Etc openvpn tun sh 71
- Ping 40 up etc openvpn tap0 br sh comp lzo 71
- Point to the peer remote 192 68 74 dev tun secret etc openvpn secrouter key cipher des ede3 cbc auth md5 tun mtu 1500 tun mtu extra 64 ping 40 ifconfig 192 68 73 192 68 74 up etc openvpn tun sh 71
- Routed ip tunnels 71
- Start bin sh value after net is the subnet behind the remote peer route add net 192 68 netmask 255 55 55 gw 5 end 71
- V2101 series linux managing communications 71
- Snmp simple network management protocol 72
- Attention 73
- Programmer s guide 74
- Define rs232_mode 0 define rs485_2wire_mode 1 define rs422_mode 2 define rs485_4wire_mode 3 75
- Dev ttys 75
- Device api 75
- Example moxali 75
- Int ioctl fd moxa_get_op_mode mode 75
- Int ioctl fd moxa_set_op_mode mode 75
- Int ioctl fd rtc_rd_time struct rtc_time time 75
- Int ioctl fd rtc_set_time struct rtc_time time 75
- Int ioctl int d unsigned long request 75
- Moxa moxa man ioctl 75
- Moxa_set_special_baud_rate moxa_get_special_baud_rate 75
- Rtc real time clock 75
- Rtc_rd_time 75
- Rtc_set_time 75
- Termio 75
- V2101 series linux programmer s guide 75
- Non standard baudrates and inaccuracy 76
- Sample script for returning the baudrate 76
- Sample script for setting the baudrate 76
- Struct termios term int fd speed fd open dev ttys0 o_rdwr tcgetattr fd term if term c_cflag cbaud cbaudex b4000000 follow the standard termios baud rate define else ioctl fd moxa_get_special_baud_rate speed 76
- Struct termios term int fd speed fd open dev ttys0 o_rdwr tcgetattr fd term term c_cflag cbaud cbaudex term c_cflag b4000000 tcsetattr fd tcsanow term speed 500000 ioctl fd moxa_set_special_baud_rate speed 76
- V2101 series linux programmer s guide 76
- Digital i o 78
- Special note 78
- Warning 78
- V2101 series linux programmer s guide 79
- Due to hardware limitation min_duration should be 60 for da710 define min_duration 40 static char datastring2 low high 80
- Media cdrom example moxali 80
- Moxa moxa cd home 80
- Moxa moxa home code cd moxalib 80
- Moxa moxa home code cp a media cdrom example moxalib 80
- Moxa moxa home code moxalib make all 80
- Moxa moxa home mkdir code cd code 80
- Sample code for digital i o control 80
- Special note 80
- V2101 series linux programmer s guide 80
- Warning 80
- Built in linux os recovery 84
- Attention 85
- Recovery environment 85
- Recovery procedure 85
- Step 1 format an empty usb disk 85
- Step 2 create a linux bootable usb disk 85
- Attention 86
- Step 3 set up the bios to boot from a usb disk 86
- V2101 series linux built in linux os recovery 86
- V2101 series linux built in linux os recovery 87
- Step 4 recover the linux system from a usb disk 88
- Attention 90
- Bios setting has been recorded on your image do you want them to be restored 90
- Step 5 reset the bios to boot from dom or compactflash 90
- V2101 series linux built in linux os recovery 90
- Y es n o 90
- A sample scripts firewalls 91
- Sample scripts firewalls 91
- A sample initialization script 92
- V2101 series linux built in linux os recovery 92
- V2101 series linux built in linux os recovery 93
- A sample firewall 94
Похожие устройства
- Moxa V2101-T-LX Руководство по быстрой установке
- Moxa V2101-T-LX Технические характеристики
- Moxa V2101-T-XPE Инструкция по эксплуатации
- Moxa V2101-T-XPE Руководство по программной части (Windows)
- Moxa V2101-T-XPE Руководство по программной части (Linux)
- Moxa V2101-T-XPE Руководство по быстрой установке
- Moxa V2101-T-XPE Технические характеристики
- Moxa DA-FX04-MM-ST-T Инструкция по эксплуатации
- Moxa DA-FX04-MM-ST-T Руководство по быстрой установке
- Moxa DA-FX04-MM-ST-T Технические характеристики
- Moxa DA-LN04-RJ Инструкция по эксплуатации
- Moxa DA-LN04-RJ Руководство по быстрой установке
- Moxa DA-LN04-RJ Технические характеристики
- Moxa DA-SP08-DB Инструкция по эксплуатации
- Moxa DA-SP08-DB Руководство по быстрой установке
- Moxa DA-SP08-DB Технические характеристики
- Moxa DA-SP08-I-DB Инструкция по эксплуатации
- Moxa DA-SP08-I-DB Руководство по быстрой установке
- Moxa DA-SP08-I-DB Технические характеристики
- Moxa DA-SP08-I-TB Инструкция по эксплуатации