Скрипт запущен:
ps -ax | grep no
6665 0 S 108:48,07 perl /usr/local/nodeny/nokernel.pl -d
6668 0 S 0:20,45 perl /usr/local/nodeny/noserver.pl -d
7982 0 S+ 0:00,00 grep no
Включаю клиента, попадаю на заглушку ввожу логин, пароль:
tail -f /usr/local/nodeny/logs/dhcp.events.log
15.04.2016 15:56:50 [commit] ip=172.16.0.2, mac=8:0:27:f7:c0:17, mac_ok=080027f7c017 | Необходима регистрация мака
15.04.2016 15:56:50 [commit] ip=172.16.0.2, mac=8:0:27:f7:c0:17, mac_ok=080027f7c017 | Необходима регистрация мака
Пробую открыть любой ресурс, попадаю на заглушку:
Доступ в интернет открыт. В адресной строке введите нужный вам сайт
Клиент светится в авторизированных в веб интерфейсе, в табличке привязка есть:
mysql> SELECT *, INET_NTOA(ip) FROM mac_uid;
+----+--------------+------------+-----+------------+------------+-------------+------------+---------------+
| id | mac | ip | uid | time | device_mac | device_port | oneconnect | INET_NTOA(ip) |
+----+--------------+------------+-----+------------+------------+-------------+------------+---------------+
| 8 | 08002715a2de | 0 | 0 | 1460675886 | | 0 | 0 | 0.0.0.0 |
| 55 | 080027f7c017 | 2886729730 | 3 | 1460725010 | | 0 | 0 | 172.16.0.2 |
+----+--------------+------------+-----+------------+------------+-------------+------------+---------------+
2 rows in set (0,00 sec)
Пайпы на клиента поднимаются:
ipfw pipe show
01016: 20.000 Mbit/s 0 ms burst 0
q132088 50 sl. 0 flows (1 buckets) sched 66552 weight 0 lmax 0 pri 0 droptail
sched 66552 type FIFO flags 0x0 0 buckets 0 active
01011: 20.000 Mbit/s 0 ms burst 0
q132083 50 sl. 0 flows (1 buckets) sched 66547 weight 0 lmax 0 pri 0 droptail
sched 66547 type FIFO flags 0x0 0 buckets 0 active
Если дернуть клиента:
15.04.2016 16:09:51 [commit] ip=172.16.0.2, mac=8:0:27:f7:c0:17, mac_ok=080027f7c017 | Ok
15.04.2016 16:09:51 [commit] ip=172.16.0.2, mac=8:0:27:f7:c0:17, mac_ok=080027f7c017 | Ok
pf поднят:
ext_if = "igb0"
set limit states 128000
set optimization aggressive
nat pass on $ext_if from {10.252.252.0/29 172.16.0.1/20 192.168.11.0/24} to any -> ($ext_if)
ipfw show
00050 596 42897 allow tcp from any to me dst-port 65443
00051 355 44209 allow tcp from me 65443 to any
00052 8463 1005647 allow tcp from any to me dst-port 4444
00053 6633 1312467 allow tcp from me 4444 to any
00054 0 0 allow tcp from any to me dst-port 4391
00055 0 0 allow tcp from me 4391 to any
00056 857 49328 allow tcp from any to me dst-port 4392
00057 771 230714 allow tcp from me 4392 to any
00058 12897 733061 allow tcp from any to me dst-port 4393
00059 17520 7477906 allow tcp from me 4393 to any
00110 1533 115162 allow ip from any to any via lo0
00120 7510 1532578 skipto 1000 ip from me to any
00130 0 0 deny icmp from any to any in icmptypes 5,9,13,14,15,16,17
00160 7188 1421164 skipto 2000 ip from any to me
00200 219 83122 skipto 500 ip from any to any via igb0
00300 4660 860707 skipto 4500 ip from any to any in
00400 0 0 skipto 450 ip from any to any recv igb0
00420 164 31690 divert 1 ip from any to any
00450 162 31502 divert 2 ip from any to any
00490 162 31502 allow ip from any to any
00500 219 83122 skipto 32500 ip from any to any in
00510 0 0 divert 1 ip from any to any
00540 0 0 allow ip from any to any
01000 3 386 allow udp from any 53,7723 to any
01010 12461 2182462 allow tcp from any to any setup keep-state
01020 563 145935 allow udp from any to any keep-state
01100 776 522304 allow ip from any to any
02000 0 0 check-state
02010 9 761 allow icmp from any to any
02020 731 93220 allow tcp from any to any dst-port 22,80,443,5006
02030 0 0 allow tcp from table(101) to any dst-port 3306
02050 151 8499 deny ip from any to any via igb0
02060 3 175 allow udp from any to any dst-port 53,7723
02100 0 0 deny ip from any to any
04500 0 0 allow ip from any to table(100)
05000 43 6499 skipto 18502 ip from table(21) to table(11)
05001 0 0 allow ip from table(41) to table(11)
18500 270 26253 fwd 127.0.0.1,8080 tcp from any to any dst-port 80
18501 4262 817125 deny ip from any to any
18502 43 6499 pipe tablearg ip from table(21) to any
32000 0 0 deny ip from any to any
32490 85 10830 deny ip from any to any
32500 0 0 allow ip from table(100) to any
33000 0 0 skipto 46501 ip from table(11) to table(31)
33001 0 0 allow ip from table(11) to table(41)
46500 212 81186 deny ip from any to any
46501 0 0 pipe tablearg ip from any to table(31)
60000 0 0 deny ip from any to any
65535 24 3719 deny ip from any to any