4gcanipv6
Revision as of 10:30, 20 October 2014 by 192.168.0.41 (talk) (Created page with " =/etc/network/interfaces= <code> auto lo eth0 wwan0 sixxs # The primary network interface iface eth0 inet static address 192.168.0.40 netmask 255.255.255....")
/etc/network/interfaces
auto lo eth0 wwan0 sixxs
# The primary network interface
iface eth0 inet static
address 192.168.0.40
netmask 255.255.255.0
broadcast 192.168.0.255
dns-nameservers 192.168.0.40 192.168.0.41
dns-search mpi2.kurrola.dy.fi mpi2.kurrola.dy.fi
dns-domain mpi1.kurrola.dy.fi mpi2.kurrola.dy.fi
network 192.168.0.0
# routes to wifi hot spots
up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.41
# it's me up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.40
up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.254
# or?
# up ip route add 192.168.1.40/24 via 192.168.0.254
# up ip route add 192.168.1.40/24 via 192.168.0.41
# GiganetEthernet IPV6
iface eth0 inet6 static
pre-up sleep 10
address 2001:14b8:100:8363::40
netmask 64
dns-nameservers 2001:14b8:100:8363::40 2001:14b8:100:8363::41
#ipv4 4G
iface wwan0 inet dhcp
pre-up /usr/bin/qmicli -d /dev/cdc-wdm? --wds-start-network=internet --client-no-release-cid
post-up shorewall start
#ipv6
iface sixxs inet manual
pre-up invoke-rc.d aiccu start
up sleep 1
up ip link set mtu 1280 dev $IFACE
post-down invoke-rc.d aiccu stop
post-up shorewall6 start
# wifi
iface wlan0 inet static
address 192.168.1.40
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0
# up ip route add 192.168.1.40/24 via 192.168.0.40
shorewall
shorewall6
keepUP script to cron tab
#!/bin/bash
DATE=`date`
PASS="`ping -I wwan0 -c 2 195.197.95.175 | grep -oP '\d+(?=% packet loss)'`"
echo "PASS IPV4: $PASS"
if [ "0" != "$PASS" ] ; then
echo "$(date) [KeepWwan0OnD] Warning: IPV4 connection lost at -- restart" >> /var/log/syslog
/home/joni/wwanREPAIR
sleep 60
if ! ['0' -eq "$(ping -I wwan0 -c 2 195.197.95.175 | grep -oP '\d+(?=% packet loss)')"]; then
echo "$(date) [KeepWwan0OnScript] Waiting for IPV4 connection going up" >> /var/log/syslog
else
echo "$(date) [KeepWwan0OnScript] IPV4 Connection ON" >> /var/log/syslog
fi
fi
# IPV6
DATE=`date`
PASS6="`ping6 -I sixxs -c 2 2a00:1450:400f:804::1009 | grep -oP '\d+(?=% packet loss)'`"
echo "PASS IPV6: $PASS6"
if [ "0" != "$PASS6" ]; then
echo "$(date) [KeepWwan0OnScript] Warning: IPV6 connection lost -- restart" >> /var/log/syslog
ifdown sixxs
sleep 10
ifup sixxs
sleep 10
webon
if ! ["0" -eq "$(echo ping6 -I sixxs -c 2 2a00:1450:400f:804::1009 | grep -oP '\d+(?=% packet loss)')"]; then
echo "$(date) [KeepWwan0OnScript] Waiting for IPV6 connection going up" >> /var/log/syslog
else
echo "$(date) [KeepWwan0OnScript] IPV6 Connection on" >> /var/log/syslog
fi
fi