Skip to content

Unable to set up on Raspberry Pi #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
djlauria opened this issue Oct 12, 2017 · 16 comments
Open

Unable to set up on Raspberry Pi #2

djlauria opened this issue Oct 12, 2017 · 16 comments

Comments

@djlauria
Copy link

I have a wired connection that I am trying to share via wifi on a Raspberry Pi 3, running latest Raspbian. Following the installation instructions in the wiki:

  1. update-rc.d bridgeap defaults gives the error: update-rc.d: error: initscript does not exist: /etc/init.d/bridgeap

  2. ignoring that and continuing, sudo /usr/local/sbin/bridgeap start gives:

Starting bridgeap interface bridging
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Invalid argument.
failed to set Master mode

@akhepcat
Copy link
Owner

  1. did you copy (or link) /usr/local/sbin/bridgeap to /etc/init.d/ , prior to running the update-rc.d?

  2. in /etc/default/bridgeap.conf, change IGNORE_MODE=0 to 1

@djlauria
Copy link
Author

djlauria commented Oct 12, 2017

Hi, changing IGNORE_MODE to 1 had no effect. Got this error again:
Starting bridgeap interface bridging
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Invalid argument.
failed to set Master mode

Is there a folder issue?
The instructions had me link the whole folder to /etc/init.d:
ln -s /usr/local/src/bridgeap /etc/init.d
Also, bridgeap.conf is in /etc/bridgeap, from here:
cp bridgeap/*conf* /etc/bridgeap

@akhepcat
Copy link
Owner

re: 1) If you're cutting and pasting from the wiki text, the '/etc/init.d' dirspec was missing a trailing slash. Most folk would automatically work around that during tab-completion, but cut-n-paste would miss it. I've added it.

re: 2) sorry, /etc/bridgeap/bridgeap.conf (staging version has /etc/default as an option) -
you may still see the error, but the script won't die on it. it's just noise from the iwconfig command trying to set master mode in a way the driver doesn't support, but that's resolved during hostapd startup.

@djlauria
Copy link
Author

Got a little further. The problem is that the command as written symlinks the folder instead of script. I needed to symlink as follows:
ln -s /usr/local/src/bridgeap/bridgeap /usr/local/sbin/
ln -s /usr/local/src/bridgeap/bridgeap /etc/init.d/

I should mention that raspbian did not have radvd, hostapd, or isc-dhcp-client installed, so I used their package manager to install them.

So the update-rc.d completes without error. I've set IGNORE_MODE to 1, and now get this:

Starting bridgeap interface bridging
Configuration file: /usr/local/src/bridgeap/hostapd.conf-bridgeap
Failed to create interface mon.wlan0: -95 (Operation not supported)
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:66:ab:ad and ssid "bridgeap"
wlan0: interface state COUNTRY_UPDATE->ENABLED
wlan0: AP-ENABLED
Internet Systems Consortium DHCP Server 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
Usage: dhcpd [-p <UDP port #>] [-f] [-d] [-q] [-t|-T]
[-4|-6] [-cf config-file] [-lf lease-file]
[-tf trace-output-file]
[-play trace-input-file]
[-pf pid-file] [--no-pid] [-s server]
[if0 [...ifN]]

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging..

exiting.
dhcp server failed to start

@akhepcat
Copy link
Owner

Ah, fixed the wiki for that missing tail. d'oh!

If you run the bridgeap script with debugging ( bash -x bridgeap start ) what does the full dhcp command look like? Different distros have different support for different options, so i'm wondering if it's a strangeness with your version of raspian...

@djlauria
Copy link
Author

Here's what I got:

`sudo bash -x /usr/local/sbin/bridgeap start

  • PROG=bridgeap
  • PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
  • VERSION=1.0
  • GITV=0
  • test -z /usr/local/sbin/bridgeap
  • [[ -r /lib/lsb/init-functions ]]
  • test run_by_init
  • . /lib/lsb/init-functions
    +++ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
    ++ for hook in '$(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null)'
    ++ '[' -r /lib/lsb/init-functions.d/20-left-info-blocks ']'
    ++ . /lib/lsb/init-functions.d/20-left-info-blocks
    ++ for hook in '$(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null)'
    ++ '[' -r /lib/lsb/init-functions.d/40-systemd ']'
    ++ . /lib/lsb/init-functions.d/40-systemd
    +++ _use_systemctl=0
    +++ '[' -d /run/systemd/system ']'
    +++ '[' -n '' ']'
    +++ '[' 1131 -ne 1 ']'
    +++ '[' -z '' ']'
    +++ '[' -z '' ']'
    +++ case $(readlink -f "$0") in
    ++++ readlink -f /usr/local/sbin/bridgeap
    +++ '[' 0 = 1 ']'
    ++ for hook in '$(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null)'
    ++ '[' -r /lib/lsb/init-functions.d/99-plymouth ']'
    ++ . /lib/lsb/init-functions.d/99-plymouth
    +++ plymouth --ping
    +++ return
    ++ FANCYTTY=
    ++ '[' -e /etc/lsb-base-logging.sh ']'
    ++ true
  • SOURCE=/usr/local/sbin/bridgeap
  • [[ -h /usr/local/sbin/bridgeap ]]
    +++ dirname /usr/local/sbin/bridgeap
    ++ cd -P /usr/local/sbin
    ++ pwd
  • DIR=/usr/local/sbin
    ++ readlink /usr/local/sbin/bridgeap
  • SOURCE=/usr/local/src/bridgeap/bridgeap
  • [[ /usr/local/src/bridgeap/bridgeap != /* ]]
  • [[ -h /usr/local/src/bridgeap/bridgeap ]]
    +++ dirname /usr/local/src/bridgeap/bridgeap
    ++ cd -P /usr/local/src/bridgeap
    ++ pwd -P
  • PDIR=/usr/local/src/bridgeap
  • SED='sed --follow-symlinks -i'
  • precheck
    ++ which ip
  • [[ -z /bin/ip ]]
    ++ which dhcpd
  • [[ -z /usr/sbin/dhcpd ]]
    ++ which ifconfig
  • [[ -z /sbin/ifconfig ]]
    ++ which iptables
  • [[ -z /sbin/iptables ]]
    ++ which hostapd
  • [[ -z /usr/sbin/hostapd ]]
    ++ which iwconfig
  • [[ -z /sbin/iwconfig ]]
    ++ which radvd
  • [[ -z /usr/sbin/radvd ]]
  • [[ 0 -gt 0 ]]
  • [[ 0 -gt 0 ]]
  • GITV=0
  • [[ -r /etc/bridgeap/bridgeap.conf ]]
  • . /etc/bridgeap/bridgeap.conf
    ++ AVOID_DOWN=1
    ++ IGNORE_MODE=1
    ++ SPIN_UNTIL_UP=3
    ++ AUTO_UPDATE=0
    ++ FORCE_WIFI=0
    ++ FORCE_ETH=0
    ++ DHCP_USER=dhcpd
    ++ DHCP_GROUP=dhcpd
    ++ BRIDGEAP_HOSTAP=/usr/local/src/bridgeap/hostapd.conf-bridgeap
    ++ BRIDGEAP_DHCP=/usr/local/src/bridgeap/dhcpd.conf-bridgeap
    ++ BRIDGEAP_DHCP_PIDF=/run/dhcpd-bridgeap.pid
    ++ BRIDGEAP_LEASES=/var/lib/dhcp/dhcpd.leases-bridgeap
    ++ BRIDGEAP_RADVDC=/usr/local/src/bridgeap/radvd.conf-bridgeap
    ++ BRIDGEAP_NET=100.64.43.0
    ++ DNS_IPS='8.8.8.8, 8.8.4.4'
    ++ RUN_DHCP=1
    ++ WPA_CHANNEL=6
    ++ SSID=bridgeap
    ++ WPA_PASS=FooMangChewIt
    ++ RUN_TUNSCRIPT=0
    ++ RUN_RADVD=0
    ++ ADDROUTE=
  • cfgcheck
  • '[' -n '' -a -z /usr/local/src/bridgeap/hostapd.conf-bridgeap ']'
  • '[' -z /usr/local/src/bridgeap/hostapd.conf-bridgeap -o '!' -r /usr/local/src/bridgeap/hostapd.conf-bridgeap ']'
  • '[' -z /usr/local/src/bridgeap/dhcpd.conf-bridgeap -o '!' -r /usr/local/src/bridgeap/dhcpd.conf-bridgeap ']'
  • [[ 0 -gt 0 ]]
  • TIP=100.64.43.1
  • BRIDGEAP_IP=100.64.43.1
  • case $1 in
  • prestart
    ++ cd /usr/local/src/bridgeap
    ++ git show --pretty=format:%h -s
  • GITV=5c3baed
  • [[ -z '' ]]
  • check_outside
    ++ grep -v 'dev[[:space:]]*br'
    ++ ip -4 route show default
  • ROUTE='default via 10.102.254.254 dev eth0 metric 202 '
  • DEFROUTE='eth0 metric 202 '
  • OUTSIDE=eth0
  • OUTSIDE=eth0
  • [[ 3 -ge 2 ]]
  • [[ -z eth0 ]]
  • [[ -z eth0 ]]
  • '[' -n 0 -a 0 -eq 1 ']'
    ++ iwconfig
    ++ grep '^[a-z0-9]'
    ++ awk '{print $1}'
    ++ grep -v eth0
    ++ grep -viE 'extensions|monitor'
  • WIFIS=wlan0
  • WIFIS=wlan0
  • [[ 1 -eq 1 ]]
  • AVOID_DOWN='NO.CARRIER|DOWN|'
    ++ ip link show
    ++ grep -vE 'NO.CARRIER|DOWN|master|wlan0|LOOP'
    ++ grep -E '\d*:[[:space:]]'
    ++ cut -f 2 -d:
    ++ awk '{print $1}'
    ++ head -1
    ++ grep -v eth0
  • ETHS=
    ++ ip route show scope link proto kernel
    ++ grep -v eth0
    ++ sed 's/^.dev[[:space:]]([a-z0-9])[[:space:]].*$/\1/g'
    ++ sort -u
  • ROUTED_IFS=
  • WIFIS=wlan0
  • '[' 0 = 1 -a 0 = 0 ']'
  • '[' 0 = 1 -a 0 = 0 ']'
  • '[' 0 = 1 -a 0 = 1 ']'
  • NUM_WIFIS=(${WIFIS})
  • NUM_WIFIS=1
  • NUM_ETHS=(${ETHS})
  • NUM_ETHS=0
  • '[' 1 -eq 0 -a 0 -eq 0 ']'
  • '[' 1 -gt 0 -a 0 -gt 0 ']'
  • [[ 1 -gt 1 ]]
  • [[ 0 -gt 1 ]]
  • WIFI=wlan0
  • INSIDE=wlan0
    ++ ip link show wlan0
    ++ grep ether
    ++ awk '{print $2}'
  • MAC=b8:27:eb:66:ab:ad
  • start
  • [[ wlan0 = \e\t\h\0 ]]
  • MSG='Starting bridgeap interface bridging'
  • run_by_init
  • '[' -n '' -a -n '' ']'
  • return 1
  • do_echo 'Starting bridgeap interface bridging'
  • MSG='Starting bridgeap interface bridging'
  • run_by_init
  • '[' -n '' -a -n '' ']'
  • return 1
  • echo 'Starting bridgeap interface bridging'
    Starting bridgeap interface bridging
  • dhcpd_reconf
  • [[ -n 100.64.43.0 ]]
  • sed --follow-symlinks -i 's/^subnet.netmask./subnet 100.64.43.0 netmask 255.255.255.0 {/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • sed --follow-symlinks -i 's/range.*/range 100.64.43.5 100.64.43.250;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • sed --follow-symlinks -i 's/(broadcast-address).*/\1 100.64.43.255;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • sed --follow-symlinks -i 's/routers.*/routers 100.64.43.1;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • sed --follow-symlinks -i 's/(fixed-address).*/\1 100.64.43.1;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • [[ -n 8.8.8.8, 8.8.4.4 ]]
  • sed --follow-symlinks -i 's/(domain-name-servers).*/\1 8.8.8.8, 8.8.4.4;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • [[ -n b8:27:eb:66:ab:ad ]]
  • sed --follow-symlinks -i 's/(ethernet).*/\1 b8:27:eb:66:ab:ad;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • [[ -d /etc/apparmor.d/dhcpd.d ]]
  • unmanage_interface
  • [[ -s /etc/NetworkManager/NetworkManager.conf ]]
    ++ grep '^iface default inet dhcp' /etc/network/interfaces
  • '[' -n '' ']'
    ++ pgrep ifplugd
  • '[' -n '' ']'
    ++ pgrep wpa_wupplicant
  • '[' -n '' ']'
    ++ pgrep -f hostapd.conf-bridgeap
  • '[' -n wlan0 -a -z '' ']'
  • hostapd_reconf
  • [[ -n 6 ]]
  • sed --follow-symlinks -i 's/(channel)=.*/\1=6/' /usr/local/src/bridgeap/hostapd.conf-bridgeap
  • [[ -n FooMangChewIt ]]
  • sed --follow-symlinks -i 's/(auth_algs)=./\1=1/; s/(wpa_passphrase)=./\1=FooMangChewIt/;' /usr/local/src/bridgeap/hostapd.conf-bridgeap
  • [[ -n bridgeap ]]
  • sed --follow-symlinks -i 's/(ssid)=.*/\1=bridgeap/' /usr/local/src/bridgeap/hostapd.conf-bridgeap
  • [[ -z FooMangChewIt ]]
  • sed --follow-symlinks -i 's/interface=.*/interface=wlan0/' /usr/local/src/bridgeap/hostapd.conf-bridgeap
  • ifconfig wlan0 up
  • [[ 1 -eq 0 ]]
  • hostapd -B /usr/local/src/bridgeap/hostapd.conf-bridgeap
    Configuration file: /usr/local/src/bridgeap/hostapd.conf-bridgeap
    Failed to create interface mon.wlan0: -95 (Operation not supported)
    wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
    wlan0: Could not connect to kernel driver
    Using interface wlan0 with hwaddr b8:27:eb:66:ab:ad and ssid "bridgeap"
    random: Only 7/20 bytes of strong random data available from /dev/random
    random: Not enough entropy pool available for secure operations
    WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
    wlan0: interface state COUNTRY_UPDATE->ENABLED
    wlan0: AP-ENABLED
  • ip -4 addr add dev wlan0 100.64.43.1/24 broadcast 100.64.43.255
  • [[ -r /var/lib/dhcp/dhcpd.leases-bridgeap ]]
  • [[ 1 -gt 0 ]]
    ++ dhcpd -h
    ++ head -1
    ++ sed 's/[a-z .]//ig'
  • DHCP_VER=431
  • [[ -z 431 ]]
  • [[ 431 -gt 422 ]]
  • DUSER='-user dhcpd'
  • DGROUP='-group dhcpd'
    ++ pgrep -f '"dhcpd.*wlan0"'
  • [[ -z '' ]]
  • dhcpd -4 -user dhcpd -group dhcpd -cf /usr/local/src/bridgeap/dhcpd.conf-bridgeap -lf /var/lib/dhcp/dhcpd.leases-bridgeap -pf /run/dhcpd-bridgeap.pid wlan0
    Internet Systems Consortium DHCP Server 4.3.1
    Copyright 2004-2014 Internet Systems Consortium.
    All rights reserved.
    Usage: dhcpd [-p <UDP port #>] [-f] [-d] [-q] [-t|-T]
    [-4|-6] [-cf config-file] [-lf lease-file]
    [-tf trace-output-file]
    [-play trace-input-file]
    [-pf pid-file] [--no-pid] [-s server]
    [if0 [...ifN]]

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging..

exiting.

  • [[ 1 -eq 0 ]]
  • do_exit 1 'dhcp server failed to start'
  • STATUS=1
  • REASON='dhcp server failed to start'
  • [[ -n dhcp server failed to start ]]
  • do_echo 'dhcp server failed to start'
  • MSG='dhcp server failed to start'
  • run_by_init
  • '[' -n '' -a -n '' ']'
  • return 1
  • echo 'dhcp server failed to start'
    dhcp server failed to start
  • run_by_init
  • '[' -n '' -a -n '' ']'
  • return 1
  • exit 1
    `

@akhepcat
Copy link
Owner

Hrm... apparently raspbian recompiled the dhcp server to remove the user/group options for your build, which means that DHCP won't drop privileges after starting (bad security design)

I'll drop an option into the config file to ignore DHCP user/group (run as root) which you'll be able to use to bypass that error.

@akhepcat
Copy link
Owner

the DHCP issue should be resolvable by unsetting the two options in the bridgeap config file: DHCP_USER and DHCP_GROUP.

comment them out, and the server -should- start up.

@djlauria
Copy link
Author

Ok, commenting those out, here is the output:

`Starting bridgeap interface bridging
Configuration file: /usr/local/src/bridgeap/hostapd.conf-bridgeap
Failed to create interface mon.wlan0: -95 (Operation not supported)
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:66:ab:ad and ssid "bridgeap"
random: Only 7/20 bytes of strong random data available from /dev/random
random: Not enough entropy pool available for secure operations
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
wlan0: interface state COUNTRY_UPDATE->ENABLED
wlan0: AP-ENABLED
Internet Systems Consortium DHCP Server 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
Usage: dhcpd [-p <UDP port #>] [-f] [-d] [-q] [-t|-T]
[-4|-6] [-cf config-file] [-lf lease-file]
[-tf trace-output-file]
[-play trace-input-file]
[-pf pid-file] [--no-pid] [-s server]
[if0 [...ifN]]

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging..

exiting.
dhcp server failed to start
`

@akhepcat
Copy link
Owner

Okay, so if it fails, always send post the logs in bash debug mode, or else it's really not useful text.

Another thing to check is your apparmor logs. That's going to be something that you might need to adjust, if you're running apparmor, or selinux. I don't have any way to help you, since I don't use them on my APs

@djlauria
Copy link
Author

Oops, sorry about that:

pi@bwrsd-pi-001:~ $ sudo bash -x /usr/local/sbin/bridgeap start

  • PROG=bridgeap
  • PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
  • VERSION=1.0
  • GITV=0
  • test -z /usr/local/sbin/bridgeap
  • [[ -r /lib/lsb/init-functions ]]
  • test run_by_init
  • . /lib/lsb/init-functions
    +++ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
    ++ for hook in '$(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null)'
    ++ '[' -r /lib/lsb/init-functions.d/20-left-info-blocks ']'
    ++ . /lib/lsb/init-functions.d/20-left-info-blocks
    ++ for hook in '$(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null)'
    ++ '[' -r /lib/lsb/init-functions.d/40-systemd ']'
    ++ . /lib/lsb/init-functions.d/40-systemd
    +++ _use_systemctl=0
    +++ '[' -d /run/systemd/system ']'
    +++ '[' -n '' ']'
    +++ '[' 1216 -ne 1 ']'
    +++ '[' -z '' ']'
    +++ '[' -z '' ']'
    +++ case $(readlink -f "$0") in
    ++++ readlink -f /usr/local/sbin/bridgeap
    +++ '[' 0 = 1 ']'
    ++ for hook in '$(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null)'
    ++ '[' -r /lib/lsb/init-functions.d/99-plymouth ']'
    ++ . /lib/lsb/init-functions.d/99-plymouth
    +++ plymouth --ping
    +++ return
    ++ FANCYTTY=
    ++ '[' -e /etc/lsb-base-logging.sh ']'
    ++ true
  • SOURCE=/usr/local/sbin/bridgeap
  • [[ -h /usr/local/sbin/bridgeap ]]
    +++ dirname /usr/local/sbin/bridgeap
    ++ cd -P /usr/local/sbin
    ++ pwd
  • DIR=/usr/local/sbin
    ++ readlink /usr/local/sbin/bridgeap
  • SOURCE=/usr/local/src/bridgeap/bridgeap
  • [[ /usr/local/src/bridgeap/bridgeap != /* ]]
  • [[ -h /usr/local/src/bridgeap/bridgeap ]]
    +++ dirname /usr/local/src/bridgeap/bridgeap
    ++ cd -P /usr/local/src/bridgeap
    ++ pwd -P
  • PDIR=/usr/local/src/bridgeap
  • SED='sed --follow-symlinks -i'
  • precheck
    ++ which ip
  • [[ -z /bin/ip ]]
    ++ which dhcpd
  • [[ -z /usr/sbin/dhcpd ]]
    ++ which ifconfig
  • [[ -z /sbin/ifconfig ]]
    ++ which iptables
  • [[ -z /sbin/iptables ]]
    ++ which hostapd
  • [[ -z /usr/sbin/hostapd ]]
    ++ which iwconfig
  • [[ -z /sbin/iwconfig ]]
    ++ which radvd
  • [[ -z /usr/sbin/radvd ]]
  • [[ 0 -gt 0 ]]
  • [[ 0 -gt 0 ]]
  • GITV=0
  • [[ -r /etc/bridgeap/bridgeap.conf ]]
  • . /etc/bridgeap/bridgeap.conf
    ++ AVOID_DOWN=1
    ++ IGNORE_MODE=1
    ++ SPIN_UNTIL_UP=3
    ++ AUTO_UPDATE=0
    ++ FORCE_WIFI=0
    ++ FORCE_ETH=0
    ++ BRIDGEAP_HOSTAP=/usr/local/src/bridgeap/hostapd.conf-bridgeap
    ++ BRIDGEAP_DHCP=/usr/local/src/bridgeap/dhcpd.conf-bridgeap
    ++ BRIDGEAP_DHCP_PIDF=/run/dhcpd-bridgeap.pid
    ++ BRIDGEAP_LEASES=/var/lib/dhcp/dhcpd.leases-bridgeap
    ++ BRIDGEAP_RADVDC=/usr/local/src/bridgeap/radvd.conf-bridgeap
    ++ BRIDGEAP_NET=100.64.43.0
    ++ DNS_IPS='8.8.8.8, 8.8.4.4'
    ++ RUN_DHCP=1
    ++ WPA_CHANNEL=6
    ++ SSID=bridgeap
    ++ WPA_PASS=FooMangChewIt
    ++ RUN_TUNSCRIPT=0
    ++ RUN_RADVD=0
    ++ ADDROUTE=
  • cfgcheck
  • '[' -n '' -a -z /usr/local/src/bridgeap/hostapd.conf-bridgeap ']'
  • '[' -z /usr/local/src/bridgeap/hostapd.conf-bridgeap -o '!' -r /usr/local/src/bridgeap/hostapd.conf-bridgeap ']'
  • '[' -z /usr/local/src/bridgeap/dhcpd.conf-bridgeap -o '!' -r /usr/local/src/bridgeap/dhcpd.conf-bridgeap ']'
  • [[ 0 -gt 0 ]]
  • TIP=100.64.43.1
  • BRIDGEAP_IP=100.64.43.1
  • case $1 in
  • prestart
    ++ cd /usr/local/src/bridgeap
    ++ git show --pretty=format:%h -s
  • GITV=5c3baed
  • [[ -z '' ]]
  • check_outside
    ++ grep -v 'dev[[:space:]]*br'
    ++ ip -4 route show default
  • ROUTE='default via 10.102.254.254 dev eth0 metric 202 '
  • DEFROUTE='eth0 metric 202 '
  • OUTSIDE=eth0
  • OUTSIDE=eth0
  • [[ 3 -ge 2 ]]
  • [[ -z eth0 ]]
  • [[ -z eth0 ]]
  • '[' -n 0 -a 0 -eq 1 ']'
    ++ iwconfig
    ++ grep '^[a-z0-9]'
    ++ grep -viE 'extensions|monitor'
    ++ awk '{print $1}'
    ++ grep -v eth0
  • WIFIS=wlan0
  • WIFIS=wlan0
  • [[ 1 -eq 1 ]]
  • AVOID_DOWN='NO.CARRIER|DOWN|'
    ++ ip link show
    ++ grep -vE 'NO.CARRIER|DOWN|master|wlan0|LOOP'
    ++ cut -f 2 -d:
    ++ grep -E '\d*:[[:space:]]'
    ++ grep -v eth0
    ++ awk '{print $1}'
    ++ head -1
  • ETHS=
    ++ sort -u
    ++ sed 's/^.dev[[:space:]]([a-z0-9])[[:space:]].*$/\1/g'
    ++ ip route show scope link proto kernel
    ++ grep -v eth0
  • ROUTED_IFS=
  • WIFIS=wlan0
  • '[' 0 = 1 -a 0 = 0 ']'
  • '[' 0 = 1 -a 0 = 0 ']'
  • '[' 0 = 1 -a 0 = 1 ']'
  • NUM_WIFIS=(${WIFIS})
  • NUM_WIFIS=1
  • NUM_ETHS=(${ETHS})
  • NUM_ETHS=0
  • '[' 1 -eq 0 -a 0 -eq 0 ']'
  • '[' 1 -gt 0 -a 0 -gt 0 ']'
  • [[ 1 -gt 1 ]]
  • [[ 0 -gt 1 ]]
  • WIFI=wlan0
  • INSIDE=wlan0
    ++ ip link show wlan0
    ++ grep ether
    ++ awk '{print $2}'
  • MAC=b8:27:eb:66:ab:ad
  • start
  • [[ wlan0 = \e\t\h\0 ]]
  • MSG='Starting bridgeap interface bridging'
  • run_by_init
  • '[' -n '' -a -n '' ']'
  • return 1
  • do_echo 'Starting bridgeap interface bridging'
  • MSG='Starting bridgeap interface bridging'
  • run_by_init
  • '[' -n '' -a -n '' ']'
  • return 1
  • echo 'Starting bridgeap interface bridging'
    Starting bridgeap interface bridging
  • dhcpd_reconf
  • [[ -n 100.64.43.0 ]]
  • sed --follow-symlinks -i 's/^subnet.netmask./subnet 100.64.43.0 netmask 255.255.255.0 {/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • sed --follow-symlinks -i 's/range.*/range 100.64.43.5 100.64.43.250;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • sed --follow-symlinks -i 's/(broadcast-address).*/\1 100.64.43.255;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • sed --follow-symlinks -i 's/routers.*/routers 100.64.43.1;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • sed --follow-symlinks -i 's/(fixed-address).*/\1 100.64.43.1;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • [[ -n 8.8.8.8, 8.8.4.4 ]]
  • sed --follow-symlinks -i 's/(domain-name-servers).*/\1 8.8.8.8, 8.8.4.4;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • [[ -n b8:27:eb:66:ab:ad ]]
  • sed --follow-symlinks -i 's/(ethernet).*/\1 b8:27:eb:66:ab:ad;/' /usr/local/src/bridgeap/dhcpd.conf-bridgeap
  • [[ -d /etc/apparmor.d/dhcpd.d ]]
  • unmanage_interface
  • [[ -s /etc/NetworkManager/NetworkManager.conf ]]
    ++ grep '^iface default inet dhcp' /etc/network/interfaces
  • '[' -n '' ']'
    ++ pgrep ifplugd
  • '[' -n '' ']'
    ++ pgrep wpa_wupplicant
  • '[' -n '' ']'
    ++ pgrep -f hostapd.conf-bridgeap
  • '[' -n wlan0 -a -z '' ']'
  • hostapd_reconf
  • [[ -n 6 ]]
  • sed --follow-symlinks -i 's/(channel)=.*/\1=6/' /usr/local/src/bridgeap/hostapd.conf-bridgeap
  • [[ -n FooMangChewIt ]]
  • sed --follow-symlinks -i 's/(auth_algs)=./\1=1/; s/(wpa_passphrase)=./\1=FooMangChewIt/;' /usr/local/src/bridgeap/hostapd.conf-bridgeap
  • [[ -n bridgeap ]]
  • sed --follow-symlinks -i 's/(ssid)=.*/\1=bridgeap/' /usr/local/src/bridgeap/hostapd.conf-bridgeap
  • [[ -z FooMangChewIt ]]
  • sed --follow-symlinks -i 's/interface=.*/interface=wlan0/' /usr/local/src/bridgeap/hostapd.conf-bridgeap
  • ifconfig wlan0 up
  • [[ 1 -eq 0 ]]
  • hostapd -B /usr/local/src/bridgeap/hostapd.conf-bridgeap
    Configuration file: /usr/local/src/bridgeap/hostapd.conf-bridgeap
    Failed to create interface mon.wlan0: -95 (Operation not supported)
    wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
    wlan0: Could not connect to kernel driver
    Using interface wlan0 with hwaddr b8:27:eb:66:ab:ad and ssid "bridgeap"
    random: Only 15/20 bytes of strong random data available from /dev/random
    random: Not enough entropy pool available for secure operations
    WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
    wlan0: interface state COUNTRY_UPDATE->ENABLED
    wlan0: AP-ENABLED
  • ip -4 addr add dev wlan0 100.64.43.1/24 broadcast 100.64.43.255
  • [[ -r /var/lib/dhcp/dhcpd.leases-bridgeap ]]
  • [[ 1 -gt 0 ]]
    ++ head -1
    ++ sed 's/[a-z .]//ig'
    ++ dhcpd -h
  • DHCP_VER=431
  • [[ -z 431 ]]
  • [[ 431 -gt 422 ]]
  • DUSER='-user '
  • DGROUP='-group '
    ++ pgrep -f '"dhcpd.*wlan0"'
  • [[ -z '' ]]
  • dhcpd -4 -user -group -cf /usr/local/src/bridgeap/dhcpd.conf-bridgeap -lf /var/lib/dhcp/dhcpd.leases-bridgeap -pf /run/dhcpd-bridgeap.pid wlan0
    Internet Systems Consortium DHCP Server 4.3.1
    Copyright 2004-2014 Internet Systems Consortium.
    All rights reserved.
    Usage: dhcpd [-p <UDP port #>] [-f] [-d] [-q] [-t|-T]
    [-4|-6] [-cf config-file] [-lf lease-file]
    [-tf trace-output-file]
    [-play trace-input-file]
    [-pf pid-file] [--no-pid] [-s server]
    [if0 [...ifN]]

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging..

exiting.

  • [[ 1 -eq 0 ]]
  • do_exit 1 'dhcp server failed to start'
  • STATUS=1
  • REASON='dhcp server failed to start'
  • [[ -n dhcp server failed to start ]]
  • do_echo 'dhcp server failed to start'
  • MSG='dhcp server failed to start'
  • run_by_init
  • '[' -n '' -a -n '' ']'
  • return 1
  • echo 'dhcp server failed to start'
    dhcp server failed to start
  • run_by_init
  • '[' -n '' -a -n '' ']'
  • return 1
  • exit 1

@akhepcat
Copy link
Owner

Try re-pulling - you don't have the latest commit.

@djlauria
Copy link
Author

And, done. This is fantastic; thanks for the extra time to get this working!

@djlauria djlauria reopened this Oct 16, 2017
@djlauria
Copy link
Author

Actually, one last question: I assumed with the presence of update-rc.d that it should start automatically, but that's not the case. No big deal, just wondering if there's anything there I can help troubleshoot before we close this.

@akhepcat
Copy link
Owner

Hrm.. it may be that your systemd configuration is not supporting the legacy /etc/init.d/ startup files.

I suppose i should look at creating a systemd-compatible unit file

@djlauria
Copy link
Author

If you do, let me know if I can help troubleshoot in some way. Everything else is working perfectly, so I'll leave it up to you as to whether to keep the issue open. Thanks again for all your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants