Gentoo Archives: gentoo-user

From: Cor Legemaat <cor@××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Configuring hostapd
Date: Thu, 06 Aug 2015 05:04:34
Message-Id: 1438837467.7575.4.camel@cor.za.net
In Reply to: Re: [gentoo-user] Configuring hostapd by Fernando Rodriguez
1 On Wed, 2015-08-05 at 01:00 -0400, Fernando Rodriguez wrote:
2 > On Tuesday, August 04, 2015 8:18:43 PM Cor Legemaat wrote:
3 > > On Sun, 2015-08-02 at 19:56 -0400, Fernando Rodriguez wrote:
4 > > > On Sunday, August 02, 2015 11:12:07 PM Mick wrote:
5 > > > > On Sunday 02 Aug 2015 22:04:41 Fernando Rodriguez wrote:
6 > > > > > On Sunday, August 02, 2015 1:29:50 PM Mick wrote:
7 > > > > > > On Sunday 02 Aug 2015 01:50:21 Fernando Rodriguez wrote:
8 > > > > > > > Hello,
9 > > > > > > >
10 > > > > > > > After installing hostapd I can successfully connect to
11 > > > > > > > the
12 > > > > > > > AP, I can
13 > > > > > > > get DHCP from it, but I cannot access the network
14 > > > > > > > through it
15 > > > > > > > (neither
16 > > > > > > > lan or internet).
17 > > > > > >
18 > > > > > > This sounds like a (network) routing problem, rather than a
19 > > > > > > hostapd
20 > > > > > > issue.
21 > > > > >
22 > > > > > It looks like that, but if I stop iptables completely on the
23 > > > > > router all
24 > > > > > unicast traffic still works in the lan (both wired and
25 > > > > > through
26 > > > > > an external
27 > > > > > AP), so if I connect to the hostapd AP with iptables off,
28 > > > > > shouldn't I at
29 > > > > > the very least be able to ping the wireless interface on the
30 > > > > > router?
31 > > > > >
32 > > > > > I also tried with only the following rule which enables
33 > > > > > internet
34 > > > > > access to
35 > > > > > all wired workstations and through external AP:
36 > > > > >
37 > > > > > iptables -t nat -A POSTROUTING -o enp0s8 -j MASQUERADE
38 > > > >
39 > > > > You should probably specify the local subnet, so that multicast
40 > > > > packets are
41 > > > > not sent out to the Internet, e.g.:
42 > > > >
43 > > > > iptables -t nat -A POSTROUTING -o enp0s8 -s 192.168.1.0/24 ! -d
44 > > > 192.168.1.0/24
45 > > > > -j MASQUERADE
46 > > > >
47 > > > > (Change 192.168.1.0/24 to suit your LAN subnet)
48 > > >
49 > > > I'm not actually using that rule except as a minimal setup for
50 > > > troubleshooting
51 > > > this issue. My actual rules do specify the subnet.
52 > > >
53 > > > > Also have you enabled ip forwarding in your kernel:
54 > > > >
55 > > > > sysctl -w net.ipv4.ip_forward=1
56 > > >
57 > > > Yes, it is an existing router that works perfectly except for the
58 > > > hostapd AP.
59 > > > My current setup is as follows:
60 > > >
61 > > > Internet -> Gentoo Router -> Switch -> AP
62 > > >
63 > > > Where AP is a wifi router with routing features disabled. Never
64 > > > had
65 > > > problems
66 > > > with it. Now I installed hostapd on "Gentoo Router" and
67 > > > everything
68 > > > else still
69 > > > works fine except when I connect to the hostapd AP. Even with
70 > > > only
71 > > > that minimal
72 > > > iptable rule or no rules at all.
73 > > >
74 > > > Thanks,
75 > > >
76 > > Probably /dev/random depleated, try enable your hardware rng or
77 > > sys-
78 > > apps/haveged test with `cat /proc/sys/kernel/random/entropy_avail`
79 > >
80 > > Regards:
81 > > Cor
82 >
83 > Thanks. II did get an error about depleted entropy at some point
84 > when starting
85 > hostapd but I went ahead and installed haveged and it still doesn't
86 > work. It
87 > doesn't even work when configured as an open AP. I checked the
88 > kernel config and
89 > I had VLAN support disabled. I've rebuilt it but can't reboot right
90 > now. Maybe
91 > it's required even though I'm not using VLANs?
92 >
93 Is there an IP configured on the interface or the bridge of that
94 interface? Can you ping your gateway? If I'm correct dhcp uses
95 broadcast but you need a valid gateway IP switchable on mac layer.
96
97 Does it stay connected? I have a problem with a link between hostapd
98 and a mikrotik device on 802.11a where I needed to patch hostapd to
99 get it to stay connected. But that should show in hostapd debug logs.
100 Mine is still running on hostapd-2.3 because if I update and screw it
101 my internet is broken, if that's your problem I will search for my
102 notes and mail it.
103
104 Regards:
105 Cor

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Configuring hostapd Fernando Rodriguez <frodriguez.developer@×××××××.com>