Come configurare un AP come routed client
Quello che vogliamo ottenere è questo: PC <--ethernet--> NOSTRO_ACCESS_POINT <--wifi--> ALTRO_ACCESS_POINT Vogliamo che il nostro ap si connetta ad un ap esterno come client. Vogliamo anche il pc prende in dhcp un IP dal nostro ap, e sia pronto a navigare.
Creare /etc/init.d/myfirewall :
# (C) 2008 openwrt.org
START=96
start() {
echo "Starting masquerading..."
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
}
stop() {
iptables -t nat -F
echo "Stopping masquerading..."
}disabilitare il firewall di default ed abilitare il nostro:
{{ /etc/init.d/firewall stop /etc/init.d/firewall disable /etc/init.d/myfirewall enable }}
Poi aggiungere a /etc/config/dhcp, nella sezione "config dhcp lan", questa riga:
option 'options' '-F lan,192.168.101.100,192.168.101.150,255.255.255.0,12h'
Dove indichiamo il range di IP che vogliamo dare in dhcp al nostro pc (i.e. su ethernet).
Cambiare /etc/network in
config interface loopback
option ifname lo
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
config interface lan
option ifname eth0
option proto static
option ipaddr 192.168.101.1
option netmask 255.255.255.0
config interface wan
option proto dhcpE infine cambiare /etc/config/wireless con qualcosa del genere:
config 'wifi-device' 'radio0'
option 'type' 'mac80211'
option 'channel' '11'
option 'macaddr' '00:15:6d:8b:9d:2f'
option 'hwmode' '11ng'
option 'htmode' 'HT20'
list 'ht_capab' 'SHORT-GI-20'
list 'ht_capab' 'SHORT-GI-40'
list 'ht_capab' 'TX-STBC'
list 'ht_capab' 'RX-STBC1'
list 'ht_capab' 'DSSS_CCK-40'
config 'wifi-iface'
option 'device' 'radio0'
option 'network' 'wan'
option 'mode' 'sta'
option 'ssid' 'www.fusolab.net'
option 'encryption' 'none'Riavviare tutto con:
wifi /etc/init.d/wireless restart /etc/init.d/network restart /etc/init.d/dnsmasq restart /etc/init.d/myfirewall start






