BBB File /etc/network/interfaces.ap

From Wiki
Jump to: navigation, search

When the WiFi is operating in AP mode, we need a different '/etc/network/interfaces' file than when in client mode. As an AP, we need a static address. See /etc/network/interfaces.client for the client file.

The /usr/local/sbin/wifiModeAP script copies this file over the '/etc/network/interfaces' file before starting the 'hostapd' daemon.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE

# WiFi Example
#auto wlan0
#iface wlan0 inet dhcp
#    wpa-ssid "essid"
#    wpa-psk  "password"

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
# Note on some boards, usb0 is automaticly setup with an init script
# in that case, to completely disable remove file [run_boot-scripts] from the boot partition
#iface usb0 inet static
#    address 192.168.7.2
#    netmask 255.255.255.0
#    network 192.168.7.0
#    gateway 192.168.7.1

allow-hotplug wlan0
iface wlan0 inet static
  address 192.168.17.1
  netmask 255.255.255.0
  network 192.168.17.0

iface default inet dhcp