T60 as Pi Ethernet-WiFi-Bridge: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
== Setup == | == Setup == | ||
The setup is exactly the same as this: [[Raspberry as Pi Ethernet-WiFi-Bridge]], with a few exceptions: | The setup is exactly the same as this: [[Raspberry as Pi Ethernet-WiFi-Bridge]], with a few exceptions: | ||
=== enableBridge.sh === | |||
The bridge itself is setup by <tt>hostapd</tt>. But it is only linked to the WiFi-Interface. So this script is launched after <tt>hostapd</tt>: | |||
DEVWIFI="wlx00e04c0f4ac0" | |||
DEVETH="ens2" | |||
DEVBR="br0" # generated by hostapd | |||
# 1: give the Bridge an IPA | |||
/sbin/ifconfig $DEVBR | grep inet | grep 10.178 > /dev/null 2>&1 | |||
if [ "$?" -ne 0 ]; then | |||
ifconfig br0 10.178.111.242 netmask 255.255.255.0 | |||
route add default gw 10.178.111.1 | |||
logger "Added $DEVBR IPA." | |||
fi | |||
# 2: remove ens2's IPA | |||
/sbin/ifconfig $DEVETH | grep inet | grep 10.178 > /dev/null 2>&1 | |||
if [ "$?" -eq 0 ]; then | |||
ip addr flush dev $DEVETH | |||
logger "Flushed $DEVETH IPA." | |||
fi | |||
# 3: Add Ethernet to bridge | |||
/sbin/brctl show $DEVBR | /bin/grep $DEVETH > /dev/null 2>&1 | |||
if [ "$?" -ne 0 ]; then | |||
# do it | |||
echo "Adding ethernet to the bridge..." | logger | |||
/sbin/brctl addif $DEVBR $DEVETH | |||
/bin/sleep 1 | |||
fi | |||
Revision as of 14:59, 18 September 2019
I used a Lenovo Thinkpad T60 (Model #2008) to supersede the Pi3.
Setup
The setup is exactly the same as this: Raspberry as Pi Ethernet-WiFi-Bridge, with a few exceptions:
enableBridge.sh
The bridge itself is setup by hostapd. But it is only linked to the WiFi-Interface. So this script is launched after hostapd:
DEVWIFI="wlx00e04c0f4ac0" DEVETH="ens2" DEVBR="br0" # generated by hostapd # 1: give the Bridge an IPA /sbin/ifconfig $DEVBR | grep inet | grep 10.178 > /dev/null 2>&1 if [ "$?" -ne 0 ]; then ifconfig br0 10.178.111.242 netmask 255.255.255.0 route add default gw 10.178.111.1 logger "Added $DEVBR IPA." fi # 2: remove ens2's IPA /sbin/ifconfig $DEVETH | grep inet | grep 10.178 > /dev/null 2>&1 if [ "$?" -eq 0 ]; then ip addr flush dev $DEVETH logger "Flushed $DEVETH IPA." fi # 3: Add Ethernet to bridge /sbin/brctl show $DEVBR | /bin/grep $DEVETH > /dev/null 2>&1 if [ "$?" -ne 0 ]; then # do it echo "Adding ethernet to the bridge..." | logger /sbin/brctl addif $DEVBR $DEVETH /bin/sleep 1 fi
Power Consumption
tbd
Troubleshooting Tips
tbd