Bridge hostapd coonected user to internet router

jan jan
Fri Nov 15 09:51:03 PST 2013


root at server:~# cat  /etc/iptables.rules
# Generated by iptables-save v1.4.12 on Mon Oct 21 14:20:11 2013
*filter
:INPUT ACCEPT [139186815:198760302176]
:FORWARD ACCEPT [164720:119001188]
:OUTPUT ACCEPT [71521197:51782117907]
-A FORWARD -i wlan0 -j ACCEPT
COMMIT
# Completed on Mon Oct 21 14:20:11 2013
# Generated by iptables-save v1.4.12 on Mon Oct 21 14:20:11 2013
*nat
:PREROUTING ACCEPT [20829:1924943]
:INPUT ACCEPT [15083:1550208]
:OUTPUT ACCEPT [377940:23333519]
:POSTROUTING ACCEPT [334113:20054009]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Mon Oct 21 14:20:11 2013


This is working config for me. Just save it an restore it with 
iptables-restore.
Or you can try the solution from the ubuntuusers.de wiki:

sysctl -w net.ipv4.ip_forward=1  #Activate the ipv4 forwarding
iptables -A FORWARD -o eth0 -i eth1 -s 10.0.0.0/24 -m conntrack 
--ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

To activate ipv4 forwarding permantly you need to edit your 
/etc/sysctl.conf.
/etc/sysctl.conf:
net.ipv4.ip_forward = 1


Jan

Am 15.11.2013 18:21, schrieb Kf Lee:
>
> HI,
>
> I just managed to install hostapd +  dhcpd and configure wlan0 to act 
> as ap in 10.0.0.1
> with android  user is able to connect the ap with an assigned ip  
> 10.0.0.65.  The pc (Linuxmint 15) that Is cable wired to the  router 
> is in 192.1.168.111 and the router  ip set to 192.168.1.1
>
> I thought tthat the Android user should be able to connect to internet 
> via pc using  iptables to forward the package but it can't.  First 
> question : is this right thinking ? If it in the rght track, can  
> anyone provide  a working example ?
>
> I search through a lot write up in the web and none actually work 
> which surprised me. This seem a quite typical use of hostapd.
>
> I also try use bridge but the brctl command say that bridge does not 
> support wlan0 .  From reading it become clear bridge is for bridging 
> wired network segments.
>
> Any help is appreciated .
> Rgds ,  kfl.
>
>
>
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20131115/61b38b44/attachment.htm>



More information about the Hostap mailing list