Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] Configuring hostapd Cor Legemaat <cor@××××××.net>