# 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 static
#	address 192.168.2.42
#	netmask 255.255.255.0
#	network 192.168.2.0
#	broadcast 192.168.2.255
#	gateway 192.168.2.253
#	# dns-* options are implemented by the resolvconf package, if installed
#	dns-nameservers 192.168.2.253
#	dns-search athome.loc

# The wireless stuff
#auto ath0
#iface ath0 inet manual
#	# name of the base (parent) device this VAP is to be attached to
#	# <iface>, no-def
#	ath_parent wifi0
#	
#	# Type of the VAP. sta means "station" or "client", ap is "Access Point"
#	# <sta|ap>, def: ap
#	ath_vaptype ap
#	
#	# Options to use when creating the VAP. 
#	# bssid (the default) causes that the MAC address of each AP VAP is
#	#     different. -bssid changes this and causes that the MAC address of
#	#     the underlaying physical wireless interface is cloned instead.
#	# nosbeacon is needed when creating a STA VAP on a physical device that
#	#     already has one or more AP VAPs, to prevent the STA VAP from
#	#     modifying the TSF clock for the AP VAPs.
#	#
#	# nosbeacon is automatically selected if necessary.
#	#
#	# [bssid|-bssid] [nosbeacon], def: bssid (AP)
#	#ath_vapopts 
#	
#	# <11a|11b|11g|11gonly|auto>, def: 11g (AP), auto (STA)
#	# 11gonly: 11g + iwpriv <iface> pureg x
#	ath_wirelessmode 11g
#	
#	# <ssid name>, def: MadWifiAP
#	ath_ssid TuxAP
#	
#	# STA only:
#	# <nick name>, def: TuxSTA
#	ath_nickname MadWifiSTA
#	
#	# <int|auto>, def: auto
#	ath_channel 6
#	
#	# AP only:
#	# <on|off>, def: off
#	ath_hidessid no
#	
#	# <none|wep|wpa>, def: none
#	ath_security wpa
#
#	# AP only:
#	# wether or not STAs are allowed to communicate with each other
#	# <on|off>, def: on
#	# => iwpriv <iface> ap_bridge x
#	ath_relay yes
#
#	### MAC Access Control List settings
#	# AP only:
#	# <off|on|black|white>, def: off
#	# note: on=white
#	ath_acl on
#	
#	# AP only:
#	# </path/to/file>, def: none
#	ath_acl_file /etc/hostapd/hostapd.deny
#
#	### WEP settings
#	ath_wep_key1 s:12345
#	ath_wep_key2 s:23456
#	ath_wep_key3 s:34567
#	ath_wep_key4 s:45678
#	
#	# [1234]
#	ath_wep_txkey 1
#	
#	# <open|shared>, def: open
#	ath_wep_mode open
#
#
#	### WPA settings
#	ath_wpa_cfgfile /etc/hostapd/hostapd.conf
#	ath_wpa_pskfile /etc/hostapd/hostapd.psk
#	ath_wpa_psk 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
#	ath_wpa_passphrase madwifirocks
#
#	# [tkip|ccmp|both], def: both
#	ath_wpa_pairwise both
#
#	# tx power for this interface
#	# <int> (dBm), no-def
#	ath_txpower 15
#	
#	# link distance (meters)
#	# <int> (m), no-def (?)
#	# XXX: TO DO
#	ath_distance 300
#
#	# maximum allowed rate, fixed or auto
#	ath_rate 11M
#
#	# STA only:
#	# how long (in seconds) to delay execution of following tasks to allow
#	# the STA VAP to associate - this is necessary to get a valid DHCP
#	# lease, for example;
#	# only applied if method "dhcp" is used in the iface-stanza
#	# <int>|on|off, def: off
#	#
#	# note:
#	# 0 means off, on means 15
#	ath_dhcp_delay on
#

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

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
