Sharing eth0 with address 192.167.1.27/24 and dns server/router 192.167.1.1
On wlan with address 192.168.0.1/24
First, you must install dnsmask and hostapd by typing in terminal: sudo apt-get install hostapd dnsmask
. After that, you must stop those services, by typing sudo service hostapd stop
and sudo service dnsmasq stop
. Also prevent them from starting at startup:
sudo update-rc.d hostapd disable
sudo update-rc.d dnsmasq disable
my /etc/dnsmasq.conf:
server=192.167.1.1
interface=wlan0
bind-interfaces
dhcp-range=192.168.0.50,192.168.0.150,12h
my hostapd.conf:
interface=wlan0
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=dellito
hw_mode=g
channel=1
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1
Start:
ifconfig wlan0 192.168.0.1 up
sysctl net.ipv4.ip_forward=1
service dnsmasq restart
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
hostapd /etc/hostapd/hostapd.conf
See what's going on / debug problems:
tcpdump -ni wlan0