#!/bin/bash # commonAircard320U.inc # written by bob fulton BRAEWORKS dec 2013 # include file contains common settings script to connect a Telstra Bigpond Sierra Wireless Aircard 320U 4G USB dongle # As of CentOS 6.5 (kernel-2.6.32-431) the usb0 network interface does not appear. # The sierra_net.c cyclic mac address has been stopped. And the natural mac address of the dongle used # # Also the "/etc/udev/rules.d/70-persistent-net.rules" file has;- # # USB device 0x0f3d:0x68aa (usb) # SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="aa:50:16:dd:d2:3d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth10" # the "aa:50:16:dd:d2:3d" mac address to replaced with the true mac address from the unit. # provided AS IS, no warranties, etc. are provided VERSION=V1.11 MODEM_PORT="/dev/ttyUSB2" NET_ETH="eth10" # was by the udev rules NET_MAC_ADDR="aa:50:16:dd:d2:3d" # same mac address as in the udev rules READ_TOUT=2 MPPID=1 # modem fifo pid # NOTES: # NOTE: USB Modeswitch has the following settings in "/etc/usb_modeswitch.d/0f3d:68aa" # snip start #-- # Telstra Aircard 320U #-- DefaultVendor=0x0f3d #-- DefaultProduct=0x68aa #-- TargetVendor=0x0f3d #-- TargetProduct=0x0257 #-- MessageContent="55534243123456782400000080000685000000240000000000000000000000" #-- CheckSuccess=20 # snip end # (remove the leading single #-- ) # NOTE: before this will work, the correct drivers must be installed from Sierra Wireless. # see "http://mycusthelpadmin.net/SIERRAWIRELESS/_cs/AnswerDetail.aspx?aid=44" for details # the correct drivers need to be downloaded, compiled and installed. # Most kernel updates will require these to be recompiled and reinstalled # NOTE: Earlier versions of this script worked with 3G connections, # but would not connect with 4G giving "+CME ERROR: no network service". # The dongle had V1.2.2 firmware. # Updating the dongle to V1.4.5 firmware cured many problems including 4G connections. # NOTE: the firewall needs to have postrouting output traffic on $NET_ETH masqueraded in the NAT section # e.g. -A POSTROUTING -o $NET_ETH -j MASQUERADE # NOTE: if you want to cut down spurious traffic and have better firewall security, # add these lines before the filter COMMIT in /etc/sysconfig/iptables # # Allow established and related connections (should already be there and before below) # -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # # Drop DHCP packets out to $NET_ETH # -A OUTPUT -p udp -m udp -o $NET_ETH --dport 67:68 -j DROP # # Stop broadcast packets out on $NET_ETH # -A OUTPUT -m pkttype -o $NET_ETH -j DROP --pkt-type broadcast # # Stop multicast packets out on $NET_ETH # -A OUTPUT -m pkttype -o $NET_ETH -j DROP --pkt-type multicast # # Stop new incomming connection requests in $NET_ETH # -A INPUT -m state -i $NET_ETH --state NEW -j DROP # NOTE: if using VMware VMs on the host, need to ensure that any bridged virtual ethernet devices dont bridge to $NET_ETH # by setting the bridge interface on host to an internal LAN interface, eg eth0 (not $NET_ETH) # (on Workstation, use vmware-netcfg to set VM bridge interface.) # NOTE: get status test #-- echo 'AT!GSTATUS?' > /dev/ttyUSB2; cat /dev/ttyUSB2 (need a control-C to terminate cat) # typical output on 4G # AT!GSTATUS? # # # !GSTATUS: # # Current Time: 556 Temperature: 38 # # Bootup Time: 1 Mode: ONLINE # # System mode: LTE PS state: Attached # # LTE band: B3 LTE bw: 10 MHz # # LTE Rx chan: 1250 LTE Tx chan: 19250 # # EMM state: Registered Normal Service # # # # RSSI (dBm): -73 Tx Power: # # RSRP (dBm): -97 TAC: 2036 (8246) # # RSRQ (dB): -10 Cell ID: 07F28A02 (133335554) # # SINR (dB): 8.8 # # # # # # OK # EOF