Skip to content

Instantly share code, notes, and snippets.

@portablejim
Created December 30, 2011 10:41
Show Gist options
  • Save portablejim/1539240 to your computer and use it in GitHub Desktop.
Save portablejim/1539240 to your computer and use it in GitHub Desktop.
Network setup (/etc/network/interfaces) for Dreamplug, with bridged wireless and ethernet and WPA2 Includes scripts to start and stop wireless network. eth0 goes to the internet, eth1 to the network, uap0 is wireless. Both eth0 and uap0 are bridged togeth
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.1.1.33
netmask 255.255.255.0
gateway 10.1.1.1
auto eth1
iface eth1 inet manual
# iface eth1 inet static
# address 192.168.1.1
# netmask 255.255.255.0
auto uap0
iface uap0 inet manual
auto net-bridge
iface net-bridge inet static
address 192.168.1.1
netmask 255.255.255.0
bridge_ports eth1 uap0
pre-up /root/start-wifi.bash
post-down /root/stop-wifi.bash
#!/bin/bash
# Install the wifi driver.
insmod /root/uap8xxx.ko 2> /dev/null || true
# Don't try to configure if already turned on..
uaputl sys_config 2> /dev/null | grep "Radio = on" && exit true
# Configure Wifi access point
uaputl sys_cfg_ssid "SSID" # Wifi SSID name
uaputl sys_cfg_protocol 32 # Use WPA2
uaputl sys_cfg_wpa_passphrase "passphrase" # Wifi passphrase
uaputl sys_cfg_cipher 8 8 # Use AES as cipher
uaputl sys_cfg_channel 8 0 # Use channel 8 (0 means manual channel)
uaputl bss_start
# Set LED
echo 1 > /sys/class/leds/guruplug\:green\:wmode/brightness
#!/bin/bash
# Exit if interface is not configured
# (no need to stop it)
uaputl sys_config 2> /dev/null | grep "Radio = off" && exit true
# Stop Wifi access point
uaputl bss_stop
# Set LED
echo 0 > /sys/class/leds/guruplug\:green\:wmode/brightness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment