# This is an interfaces(5) example implementing a hotspot repeater, using
# one STA VAP and one AP VAP.
#
# The STA VAP connects to a hotspot Access Point, requesting IP
# configuration via DHCP. The AP VAP creates a new cell for other stations,
# forwarding the hotspot's internet connectivity to these stations and
# providing NAT functionality.
#
# For this example, IP forwarding needs to be enabled:
#   echo "net/ipv4/ip_forward=1" >> /etc/sysctl.conf
# Support for dynamic IP addresses is useful, too:
#   echo "net/ipv4/ip_dynaddr=1" >> /etc/sysctl.conf

# The loopback network interface
auto lo
iface lo inet loopback

# The STA VAP that will connect to the hotspot
auto ath0
iface ath0 inet dhcp
	ath_parent wifi0	
	ath_vaptype sta
	ath_vapopts nosbeacon
	ath_nickname MadWifiSTA1
	ath_ssid Hotspot
	ath_txpower 15
	ath_dhcp_delay on

# The AP VAP for the other stations
auto ath1
iface ath1 inet static
	ath_parent wifi0
	ath_vaptype ap
	ath_ssid TuxAP
	ath_hidessid no
	ath_security none
	ath_txpower 15
	address 192.168.5.1
	netmask 255.255.255.0
	network 192.168.5.0
	broadcast 192.168.5.255
	up /sbin/iptables -t nat -A POSTROUTING -s 192.168.5.0/24 -o ath0 -j MASQUERADE
