eth0 and wlan0 on the same lan subnet ? February 24, 2015 04:36AM |
Registered: 10 years ago Posts: 168 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 08:45AM |
Registered: 9 years ago Posts: 70 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 12:45PM |
Registered: 9 years ago Posts: 1,037 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 03:45PM |
Registered: 13 years ago Posts: 406 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 04:02PM |
Registered: 9 years ago Posts: 70 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 04:49PM |
Registered: 13 years ago Posts: 406 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 05:00PM |
Registered: 9 years ago Posts: 70 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 05:09PM |
Registered: 13 years ago Posts: 406 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 05:16PM |
Registered: 9 years ago Posts: 70 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 05:27PM |
Admin Registered: 13 years ago Posts: 18,580 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 05:30PM |
Registered: 9 years ago Posts: 70 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 05:35PM |
Admin Registered: 13 years ago Posts: 18,580 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 05:39PM |
Registered: 13 years ago Posts: 406 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 05:39PM |
Registered: 9 years ago Posts: 70 |
Re: eth0 and wlan0 on the same lan subnet ? February 24, 2015 06:24PM |
Registered: 9 years ago Posts: 70 |
Re: eth0 and wlan0 on the same lan subnet ? February 25, 2015 11:36AM |
Registered: 9 years ago Posts: 1,037 |
Re: eth0 and wlan0 on the same lan subnet ? February 25, 2015 07:56PM |
Registered: 10 years ago Posts: 168 |
#!/bin/bash # (c) Don Charisma 2015 - Please do give credit and link back to me if you're reusing this script - to # http://DonCharisma.org and http://DonCharisma.com # and this post :D GATEWAY=192.168.1.3 SUBNET=255.255.255.0 NETWORK=192.168.1.0 WIRED=eth0 WIRELESS=wlan0 CURRENT_WIRE_OPERSTATE=up PREVIOUS_WIRE_OPERSTATE=up while [ true ] ; do CURRENT_WIRE_OPERSTATE=`cat /sys/class/net/$WIRED/operstate` echo "Current state : $CURRENT_WIRE_OPERSTATE" echo "Previous state : $PREVIOUS_WIRE_OPERSTATE" if [[ "${PREVIOUS_WIRE_OPERSTATE}" = "up" && "${CURRENT_WIRE_OPERSTATE}" = "down" ]] then # when wired network has gone down echo "Wired network gone down" # “DOWN” the wired network route del default $WIRED route del -net $NETWORK netmask $SUBNET $WIRED # “UP” the wireless network route add -net $NETWORK netmask $SUBNET $WIRELESS route add default gw $GATEWAY $WIRELESS elif [[ "${PREVIOUS_WIRE_OPERSTATE}" = "down" && "${CURRENT_WIRE_OPERSTATE}" = "up" ]] then # when wired network comes back up echo "Wired network is back up" # “UP” the wired network route add -net $NETWORK netmask $SUBNET $WIRED route add default gw $GATEWAY $WIRED # “DOWN” the wireless network route del default $WIRELESS route del -net $NETWORK netmask $SUBNET $WIRELESS fi PREVIOUS_WIRE_OPERSTATE=$CURRENT_WIRE_OPERSTATE sleep 5 done
Re: eth0 and wlan0 on the same lan subnet ? February 25, 2015 08:09PM |
Admin Registered: 13 years ago Posts: 18,580 |
Re: eth0 and wlan0 on the same lan subnet ? February 26, 2015 04:30AM |
Registered: 10 years ago Posts: 168 |
Re: eth0 and wlan0 on the same lan subnet ? February 26, 2015 07:45AM |
Registered: 9 years ago Posts: 1,037 |
Re: eth0 and wlan0 on the same lan subnet ? April 05, 2016 02:19PM |
Registered: 9 years ago Posts: 1,037 |
furriephillips
Re: eth0 and wlan0 on the same lan subnet ? August 13, 2016 05:09PM |
kernel: IPv4: martian source 10.0.0.255 from 10.0.0.51, on dev eth0 kernel: ll header: 00000000: ff ff ff ff ff ff 60 57 18 56 a7 11 08 00 ......`W.V.... kernel: IPv4: martian source 255.255.255.255 from 10.0.0.50, on dev wlan0 kernel: ll header: 00000000: ff ff ff ff ff ff 74 e6 e2 36 ea 6b 08 00 ......t..6.k.. kernel: IPv4: martian source 10.0.0.255 from 10.0.0.10, on dev wlan0 kernel: ll header: 00000000: ff ff ff ff ff ff 00 08 9b d3 15 64 08 00 ...........d..