1 клієнта на порту - не працює чи я щось роблю не так?
- створив абонента
- Підключаюсь через "мильницю"
/var/log/dhcpd.log
Apr 11 11:11:39 DHCP dhcpd: DHCPDISCOVER from 04:7d:7b:c3:22:06 via em1
Apr 11 11:11:40 DHCP dhcpd: DHCPOFFER on 10.100.0.2 to 04:7d:7b:c3:22:06 (microsof-9e6093) via em1
Apr 11 11:11:40 DHCP dhcpd: execute_statement argv[0] = /usr/bin/perl
Apr 11 11:11:40 DHCP dhcpd: execute_statement argv[1] = /usr/local/nodeny/modules/dhcp/events.pl
Apr 11 11:11:40 DHCP dhcpd: execute_statement argv[2] = commit
Apr 11 11:11:40 DHCP dhcpd: execute_statement argv[3] = 10.100.0.2
Apr 11 11:11:40 DHCP dhcpd: execute_statement argv[4] = 4:7d:7b:c3:22:6
Apr 11 11:11:40 DHCP dhcpd: execute_statement argv[5] =
Apr 11 11:11:40 DHCP dhcpd: execute_statement argv[6] =
Apr 11 11:11:41 DHCP dhcpd: DHCPREQUEST for 10.100.0.2 (10.100.0.1) from 04:7d:7b:c3:22:06 (microsof-9e6093) via em1
Apr 11 11:11:41 DHCP dhcpd: DHCPACK on 10.100.0.2 to 04:7d:7b:c3:22:06 (microsof-9e6093) via em1
/usr/local/nodeny/logs/dhcp.events.log
11.04.2014 11:11:41 [commit] ip=10.100.0.2, mac=4:7d:7b:c3:22:6, mac_ok=047d7bc32206 | Необходима регистрация мака
11.04.2014 11:26:40 [commit] ip=10.100.0.2, mac=4:7d:7b:c3:22:6, mac_ok=047d7bc32206 | Ok
підключаємось через cisco sf300-24
#Конфіг свіча
show startup-config
ip dhcp snooping
ip dhcp snooping vlan 1
ip dhcp relay address 10.100.0.1
ip dhcp relay enable
ip dhcp information option
....
interface fastethernet24
ip dhcp snooping trust
/usr/local/nodeny/logs/dhcp.events.log
11.04.2014 11:48:46 ERROR: [commit] ip=10.100.0.7, mac=12:32:1e:43:de:12, mac_ok=12321e43de12, port=00065ca48a6d9703[8] | select uid from mac_uid error
mysql> show create table mac_uid;
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mac_uid | CREATE TABLE `mac_uid` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`mac` varchar(12) DEFAULT NULL,
`ip` int(10) unsigned NOT NULL,
`uid` bigint(20) unsigned NOT NULL,
`time` int(10) unsigned NOT NULL,
`device_mac` varchar(12) NOT NULL,
`device_port` smallint(6) NOT NULL,
`oneconnect` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `mac` (`mac`),
KEY `uid` (`uid`),
KEY `time` (`time`),
KEY `ip` (`ip`)
) ENGINE=InnoDB AUTO_INCREMENT=89 DEFAULT CHARSET=utf8 |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT *, INET_NTOA(ip) FROM mac_uid;
+----+--------------+-----------+-----+------------+---------------+-------------+------------+---------------+
| id | mac | ip | uid | time | device_mac | device_port | oneconnect | INET_NTOA(ip) |
+----+--------------+-----------+-----+------------+---------------+-------------+------------+---------------+
| 86 | 047d7bc32206 | 0 | 10 | 1397204800 | | 0 | 0 | 0.0.0.0 |
| 88 | 12321e43de12 | 174325767| 0 | 1397206126 | 00065ca48a6d | 8 | 0 | 10.100.0.7 |
+----+--------------+-----------+-----+------------+--------------+--------------+-------------+---------------+
2 rows in set (0.00 sec)
Проходим через заглушку - все працює (правда відвалюється клієнт через деякий час, але над цим пізніше)
mysql> SELECT *, INET_NTOA(ip) FROM mac_uid;
+----+--------------+-----------+-----+------------+--------------+-------------+------------+---------------+
| id | mac | ip | uid | time | device_mac | device_port | oneconnect | INET_NTOA(ip) |
+----+--------------+-----------+-----+------------+--------------+-------------+------------+---------------+
| 86 | 047d7bc32206 | 0 | 0 | 1397204800 | | 0 | 0 | 0.0.0.0 |
| 88 | NULL | 174325767 | 0 | 1397206126 | 00065ca48a6d | 8 | 0 | 10.100.0.7 |
| 89 | 12321e43de12 | 174325767 | 10 | 1397207026 | 00065ca48a6d | 8 | 0 | 10.100.0.7 |
+----+--------------+-----------+-----+------------+--------------+-------------+------------+---------------+
3 rows in set (0.00 sec)
Ставим галочку 1 клієнт на порту, зберігаємо
mysql> SELECT *, INET_NTOA(ip) FROM mac_uid;
+----+--------------+-----------+-----+------------+--------------+-------------+------------+---------------+
| id | mac | ip | uid | time | device_mac | device_port | oneconnect | INET_NTOA(ip) |
+----+--------------+-----------+-----+------------+--------------+-------------+------------+---------------+
| 86 | 047d7bc32206 | 0 | 0 | 1397204800 | | 0 | 0 | 0.0.0.0 |
| 89 | 12321e43de12 | 174325767 | 10 | 1397207026 | 00065ca48a6d | 8 | 2 | 10.100.0.7 |
+----+--------------+-----------+-----+------------+--------------+-------------+------------+---------------+
2 rows in set (0.00 sec)
Міняємо мак і все по новому (заглушка, помилка, доступ в інету немає поки не пройти авторизацію)