# # #script that makes it all work again :) # #!/bin/bash modprobe -r ipw2200 && modprobe ipw2200 && iwconfig eth2 essid e-wireless enc MYWEPKEY:) mode managed && ifconfig eth2 192.168.0.4 && route add default gw 192.168.0.1 && echo "nameserver 192.168.0.1" > /etc/resolv.conf # # some output to illustrate the problem # agoraeus:/etc/default# bash /home/pieter/tmp/restart_network.sh agoraeus:/etc/default# ping www.google.be PING www.l.google.com (64.233.183.103) 56(84) bytes of data. 64 bytes from nf-in-f103.google.com (64.233.183.103): icmp_seq=1 ttl=238 time=131 ms 64 bytes from nf-in-f103.google.com (64.233.183.103): icmp_seq=2 ttl=238 time=863 ms 64 bytes from nf-in-f103.google.com (64.233.183.103): icmp_seq=3 ttl=238 time=27.6 ms --- www.l.google.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2008ms rtt min/avg/max/mdev = 27.686/340.680/863.253/371.918 ms agoraeus:/etc/default# ifdown eth2 agoraeus:/etc/default# ifup eth2 agoraeus:/etc/default# ping 192.168.0.1 PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data. From 192.168.0.4 icmp_seq=2 Destination Host Unreachable From 192.168.0.4 icmp_seq=3 Destination Host Unreachable From 192.168.0.4 icmp_seq=4 Destination Host Unreachable --- 192.168.0.1 ping statistics --- 6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5000ms , pipe 3 agoraeus:/etc/default# bash /home/pieter/tmp/restart_network.sh agoraeus:/etc/default# ping 192.168.0.1 PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data. 64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=6.95 ms 64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=2.11 ms --- 192.168.0.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1003ms rtt min/avg/max/mdev = 2.116/4.536/6.956/2.420 ms agoraeus:/etc/default# ping www.google.be PING www.l.google.com (64.233.183.99) 56(84) bytes of data. 64 bytes from nf-in-f99.google.com (64.233.183.99): icmp_seq=1 ttl=238 time=27.1 ms --- www.l.google.com ping statistics --- 2 packets transmitted, 1 received, 50% packet loss, time 999ms rtt min/avg/max/mdev = 27.138/27.138/27.138/0.000 ms agoraeus:/etc/default#