Gentoo Archives: gentoo-user

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

Attachments

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

Replies

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