Hi there.
Need some help from BSD seniors. I'm trying to build a simple filter for WiFi users that want to get Internet access, and allow them access by MAC address.
I've rebuilt the kernel with:
Then enabled MAC filter:
ae0 - interface to the internet
wlan0 - WiFi AP for LAN
So I have some rules:
My logic:
But it didn't work. As you can see, packets rut by rule #1000 too, but when I'm trying to open some webpage, it forwards me back to the authentication page.
Additional rules, ex:
and other additional rules to approve reverse traffic didn't help..
But if I make a rule with keep-state
it works normally.
If I change MAC or IP -> redirect to authentication page.
I Googled about my problem for five days and six nights before asking you. I've not found an answer. FreeBSD.Org comunity - my last hope.
Need some help from BSD seniors. I'm trying to build a simple filter for WiFi users that want to get Internet access, and allow them access by MAC address.
I've rebuilt the kernel with:
Code:
options IPFIREWALL
options IPFIREWALL_FORWARD
options IPFIREWALL_NAT
options IPDIVERT
options DUMMYNET
options LIBALIAS
Then enabled MAC filter:
Code:
#sysctl net.link.ether.ipfw=1
ae0 - interface to the internet
wlan0 - WiFi AP for LAN
So I have some rules:
Code:
00010 1255 519814 divert 8668 ip from any to any
00020 68 4348 allow ip from any to any dst-port 53
00040 16 736 allow ip from any to me dst-port 80
01000 388 317422 allow ip from 192.168.0.11 to any MAC any 00:19:e0:8d:d0:43
60000 409 321902 fwd 192.168.0.1,80 ip from 192.168.0.0/24 to any in via wlan0
65000 542 182189 allow ip from any to any
65535 336 54118 deny ip from any to any
My logic:
Code:
#10 - NAT
#20 - DNS queries
#40 - www at localhost
#1000 - accept ip 192.168.0.11 with mac 00:19:e0:8d:d0:43 to any
#60000 - forwarding to localhost www page with authorization. If password is correct, script adding to firewall rule such as #1000
But it didn't work. As you can see, packets rut by rule #1000 too, but when I'm trying to open some webpage, it forwards me back to the authentication page.
Additional rules, ex:
Code:
01000 312 131227 allow ip from any to 192.168.0.11 MAC 00:19:e0:8d:d0:43 any #packets runs too
But if I make a rule with keep-state
Code:
allow ip from 192.168.0.11 to any MAC any 00:19:e0:8d:d0:43 keep-state
If I change MAC or IP -> redirect to authentication page.
I Googled about my problem for five days and six nights before asking you. I've not found an answer. FreeBSD.Org comunity - my last hope.