Перейти к содержимому
Калькуляторы

ga6iem

Пользователи
  • Публикации

    16
  • Зарегистрирован

  • Посещение

Все публикации пользователя ga6iem


  1. Классическая ситуация. Два удаленных офиса и сервак в центре. pptpclient1,2 - Роутеры с OpenWRT pptpserver - CentOS 5.6 ---- IP MAP: lan1 - 192.168.1.0/24 lan2 - 192.168.2.0/24 pptpserver - 10.2.2.1 pptpclient1 - 10.2.2.151 pptpclient2 - 10.2.2.152 --- Схема: (lan1->pptpclient1->)pptpserver->(pptpclient2->lan2) Сейчас VPN поднят. Из локалок lan1,2 пинги проходят в 10.2.2.0/24 Нужно ходить из lan1 в lan2 и наоборот. Как сделать? Понимаю что копать в сторону IPTABLES но чую застряну в них. Ну помогите кто сталкивался :beer: Да, конфиг фаерволов на клиентских рутерах: config 'defaults' option 'syn_flood' '1' option 'input' 'ACCEPT' option 'output' 'ACCEPT' option 'forward' 'REJECT' option 'drop_invalid' '1' config 'zone' option 'name' 'lan' option 'input' 'ACCEPT' option 'output' 'ACCEPT' option 'forward' 'REJECT' option 'network' 'lan' config 'zone' option 'name' 'wan' option 'input' 'REJECT' option 'output' 'ACCEPT' option 'forward' 'REJECT' option 'masq' '1' option 'mtu_fix' '1' option 'network' 'wan' config 'forwarding' option 'src' 'lan' option 'dest' 'wan' config 'zone' option 'name' 'wimax' option 'input' 'REJECT' option 'output' 'ACCEPT' option 'forward' 'REJECT' option 'masq' '1' option 'mtu_fix' '1' option 'network' 'wimax' config 'forwarding' option 'src' 'lan' option 'dest' 'wimax' config 'rule' option 'src' 'wan' option 'proto' 'udp' option 'dest_port' '68' option 'target' 'ACCEPT' option 'family' 'ipv4' config 'rule' option 'src' 'wan' option 'proto' 'icmp' option 'icmp_type' 'echo-request' option 'target' 'ACCEPT' config 'include' option 'path' '/etc/firewall.user' config 'zone' option 'input' 'ACCEPT' option 'output' 'ACCEPT' option 'name' 'vpn' option 'forward' 'ACCEPT' option 'network' 'vpn' option 'masq' '1' option 'mtu_fix' '1' config 'forwarding' option 'dest' 'lan' option 'src' 'vpn' config 'forwarding' option 'dest' 'wan' option 'src' 'vpn' config 'forwarding' option 'dest' 'vpn' option 'src' 'lan' config 'forwarding' option 'dest' 'vpn' option 'src' 'wan' config 'rule' option 'target' 'ACCEPT' config 'rule' option 'target' 'ACCEPT' option '_name' 'vpn_rules' option 'src' 'vpn' option 'proto' 'all' config 'rule' option 'target' 'ACCEPT' config 'rule' option 'target' 'ACCEPT' option '_name' 'vpnin_rules' option 'src' 'lan' option 'dest' 'vpn' option 'proto' 'all'
  2. Разобрался. Оказывается от перемены мест слагаемых сумма всет-ки меняется.. Надо так: shared-network dlink { subnet 10.20.0.0 netmask 255.255.255.0 { option broadcast-address 10.20.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.20.0.1,8.8.8.8; option routers 10.20.0.1; class "port22" { match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "22" and binary-to-ascii(10, 8, ".", packet(24, 4)) = "10.0.0.101"; # and binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2)) = "2"; } # собственно выдаем IP классу pool { range 10.20.0.22; allow members of "port22"; } subnet 10.0.0.0 netmask 255.255.255.0 { range 10.0.0.2 10.0.0.90; option broadcast-address 10.0.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.0.0.1,8.8.8.8; option routers 10.0.0.1; } } Все щастливы: Sep 9 14:58:31 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:58:31 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f via 10.0.0.101 Sep 9 14:58:32 Server dhcpd: DHCPOFFER on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:58:32 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:58:32 Server dhcpd: DHCPREQUEST for 10.20.0.22 (10.0.0.1) from 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:58:32 Server dhcpd: DHCPACK on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:58:47 Server dhcpd: - Lease: 10.0.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 14:58:47 Server dhcpd: DHCPDISCOVER from 00:0a:e4:33:3c:97 via 10.0.0.101 Sep 9 14:58:48 Server dhcpd: DHCPOFFER on 10.0.0.22 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 14:58:48 Server dhcpd: - Lease: 10.0.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 14:58:48 Server dhcpd: DHCPREQUEST for 10.0.0.22 (10.0.0.1) from 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 14:58:48 Server dhcpd: DHCPACK on 10.0.0.22 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101
  3. DES-3200-28 DES-3200-28:5#show dhcp_relay Command: show dhcp_relay DHCP/BOOTP Relay Status : Enabled DHCP/BOOTP Hops Count Limit : 4 DHCP/BOOTP Relay Time Threshold : 0 DHCP Relay Agent Information Option 82 State : Enabled DHCP Relay Agent Information Option 82 Check : Disabled DHCP Relay Agent Information Option 82 Policy : Keep DHCP Relay Agent Information Option 82 Remote ID : 00-1E-58-6F-03-40 Interface Server 1 Server 2 Server 3 Server 4 ------------ --------------- --------------- --------------- -------------- System 10.0.0.1 DES-3200-28:5#sh vlan Command: show vlan VID : 1 VLAN Name : default VLAN Type : Static Advertisement : Enabled Member Ports : 1-21,23-28 Static Ports : 1-21,23-28 Current Tagged Ports : Current Untagged Ports : 1-21,23-28 Static Tagged Ports : Static Untagged Ports : 1-21,23-28 Forbidden Ports : VID : 2 VLAN Name : v2 VLAN Type : Static Advertisement : Disabled Member Ports : 1,22 Static Ports : 1,22 Current Tagged Ports : 1 Current Untagged Ports : 22 Static Tagged Ports : 1 Static Untagged Ports : 22 Forbidden Ports : Total Entries : 2 если dhcpd.conf shared-network dlink { subnet 10.0.0.0 netmask 255.255.255.0 { range 10.0.0.2 10.0.0.90; option broadcast-address 10.0.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.0.0.1,8.8.8.8; option routers 10.0.0.1; } subnet 10.20.0.0 netmask 255.255.255.0 { option broadcast-address 10.20.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.20.0.1,8.8.8.8; option routers 10.20.0.1; class "port22" { match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "22" and binary-to-ascii(10, 8, ".", packet(24, 4)) = "10.0.0.101"; # and binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2)) = "2"; } # собственно выдаем IP классу pool { range 10.20.0.22; allow members of "port22"; } } то Sep 9 14:10:10 Server dhcpd: - Lease: 10.0.0.2 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:10:10 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f via 10.0.0.101 Sep 9 14:10:11 Server dhcpd: DHCPOFFER on 10.0.0.2 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:10:11 Server dhcpd: - Lease: 10.0.0.2 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:10:11 Server dhcpd: DHCPREQUEST for 10.0.0.2 (10.0.0.1) from 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:10:11 Server dhcpd: DHCPACK on 10.0.0.2 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 т.е. не работает. Если так: shared-network dlink { subnet 10.0.0.0 netmask 255.255.255.0 { } subnet 10.20.0.0 netmask 255.255.255.0 { option broadcast-address 10.20.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.20.0.1,8.8.8.8; option routers 10.20.0.1; class "port22" { match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "22" and binary-to-ascii(10, 8, ".", packet(24, 4)) = "10.0.0.101"; # and binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2)) = "2"; } # собственно выдаем IP классу pool { range 10.20.0.22; allow members of "port22"; } } то Sep 9 14:28:26 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:28:26 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f via 10.0.0.101 Sep 9 14:28:27 Server dhcpd: DHCPOFFER on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:28:27 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 14:28:27 Server dhcpd: DHCPREQUEST for 10.20.0.22 (10.0.0.1) from 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 14:28:27 Server dhcpd: DHCPACK on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 работает, т.е. отдает 10.20.0.22 в 22 порт, но так же отдает всем остальным портам сабнет 10.20.0.0/24 Sep 9 14:47:15 Server dhcpd: - Lease: 10.20.0.29 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 14:47:15 Server dhcpd: DHCPDISCOVER from 00:0a:e4:33:3c:97 via 10.0.0.101 Sep 9 14:47:16 Server dhcpd: DHCPOFFER on 10.20.0.29 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 14:47:16 Server dhcpd: - Lease: 10.20.0.29 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 14:47:16 Server dhcpd: DHCPREQUEST for 10.20.0.29 (10.0.0.1) from 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 14:47:16 Server dhcpd: DHCPACK on 10.20.0.29 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 пс: 10.20.0.29 - это мой ноут на 28 порте в первом vlan
  4. Да примитив. Стенд: DES-3200-28:5#sh vlan Command: show vlan VID : 1 VLAN Name : default VLAN Type : Static Advertisement : Enabled Member Ports : 1-21,23-28 Static Ports : 1-21,23-28 Current Tagged Ports : Current Untagged Ports : 1-21,23-28 Static Tagged Ports : Static Untagged Ports : 1-21,23-28 Forbidden Ports : VID : 2 VLAN Name : v2 VLAN Type : Static Advertisement : Disabled Member Ports : 1,22 Static Ports : 1,22 Current Tagged Ports : 1 Current Untagged Ports : 22 Static Tagged Ports : 1 Static Untagged Ports : 22 Forbidden Ports : Total Entries : 2 В первый порт соответственно воткнут DHCP. 1-21,23-28 порты vlan1 (10.0.0.0/24) Задача в 22 порт (vlan2) выдать 10.20.0.22/24
  5. хмм, так shared-network dlink { subnet 10.0.0.0 netmask 255.255.255.0 { # range 10.0.0.2 10.0.0.90; # option broadcast-address 10.0.0.255; # option subnet-mask 255.255.255.0; # option domain-name-servers 10.0.0.1,8.8.8.8; # option routers 10.0.0.1; } subnet 10.20.0.0 netmask 255.255.255.0 { option broadcast-address 10.20.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.20.0.1,8.8.8.8; option routers 10.20.0.1; class "port22" { match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "22" and binary-to-ascii(10, 8, ".", packet(24, 4)) = "10.0.0.101"; } # собственно выдаем IP классу pool { range 10.20.0.22; allow members of "port22"; } } работает. Sep 9 11:57:17 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 11:57:17 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f via 10.0.0.101 Sep 9 11:57:18 Server dhcpd: DHCPOFFER on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 11:57:18 Server dhcpd: - Lease: 10.20.0.22 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 9 11:57:18 Server dhcpd: DHCPREQUEST for 10.20.0.22 (10.0.0.1) from 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 9 11:57:18 Server dhcpd: DHCPACK on 10.20.0.22 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 А почему?, не понятна логика работы dhcpd.. Причем здесь subnet 10.0.0.0/24 и как для нее теперь выдавать аренду? Теперь в логе Sep 9 11:59:00 Server dhcpd: DHCPREQUEST for 10.0.0.22 from 00:0a:e4:33:3c:97 via eth1: unknown lease 10.0.0.22. Sep 9 11:59:13 Server last message repeated 2 times Sep 9 12:00:03 Server dhcpd: DHCPREQUEST for 10.0.0.22 from 00:0a:e4:33:3c:97 via 10.0.0.101: unknown lease 10.0.0.22. и сразу Sep 7 12:15:38 Server dhcpd: lease 10.20.0.29: no subnet. Sep 9 12:04:01 Server dhcpd: - Lease: 10.20.0.29 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 12:04:02 Server dhcpd: DHCPOFFER on 10.20.0.29 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 12:04:02 Server dhcpd: - Lease: 10.20.0.29 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 28 in VLAN: 1 Sep 9 12:04:02 Server dhcpd: DHCPREQUEST for 10.20.0.29 (10.0.0.1) from 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 Sep 9 12:04:02 Server dhcpd: DHCPACK on 10.20.0.29 to 00:0a:e4:33:3c:97 (artyom) via 10.0.0.101 т.е. как видно начинает выдавать в subnet1 адреса из subnet2 (10.20.0.0/24). Почему? Основываясь на ip коммутатора 10.0.0.101? Тогда почему не учитывает № порта?
  6. [root@Server ~]# killall /usr/local/sbin/dhcpd [root@Server ~]# > /var/db/dhcpd.leases [root@Server ~]# /usr/local/sbin/dhcpd Internet Systems Consortium DHCP Server 4.2.1-P1 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Wrote 0 class decls to leases file. Wrote 0 leases to leases file. Multiple interfaces match the same shared network: eth1 eth1.2 Listening on LPF/vmnet3/00:50:56:c0:00:03/172.16.244.0/24 Sending on LPF/vmnet3/00:50:56:c0:00:03/172.16.244.0/24 Listening on LPF/eth1.4/00:e0:4c:c2:0a:28/10.40.0.0/24 Sending on LPF/eth1.4/00:e0:4c:c2:0a:28/10.40.0.0/24 Listening on LPF/eth1.3/00:e0:4c:c2:0a:28/10.30.0.0/24 Sending on LPF/eth1.3/00:e0:4c:c2:0a:28/10.30.0.0/24 Listening on LPF/eth1.2/00:e0:4c:c2:0a:28/dlink Sending on LPF/eth1.2/00:e0:4c:c2:0a:28/dlink Listening on LPF/eth1/00:e0:4c:c2:0a:28/dlink Sending on LPF/eth1/00:e0:4c:c2:0a:28/dlink Listening on LPF/eth0/00:14:2a:66:59:1b/192.168.26.0/24 Sending on LPF/eth0/00:14:2a:66:59:1b/192.168.26.0/24 Sending on Socket/fallback/fallback-net [root@Server ~]# tail -f /var/log/messages Sep 8 10:15:47 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f via 10.0.0.101 Sep 8 10:15:48 Server dhcpd: DHCPOFFER on 10.0.0.2 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 8 10:15:48 Server dhcpd: - Lease: 10.0.0.2 via IP: 10.0.0.101 (MAC: 00:1e:58:6f:3:40) on port: 22 in VLAN: 2 Sep 8 10:15:48 Server dhcpd: DHCPDISCOVER from 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 8 10:15:48 Server dhcpd: DHCPOFFER on 10.0.0.2 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 чето нифига не пашет =(
  7. Настраиваю релеем DES-3200 к DHCP 4.1 DES-3200-28:5#show dhcp_relay Command: show dhcp_relay DHCP/BOOTP Relay Status : Enabled DHCP/BOOTP Hops Count Limit : 4 DHCP/BOOTP Relay Time Threshold : 0 DHCP Relay Agent Information Option 82 State : Enabled DHCP Relay Agent Information Option 82 Check : Enabled DHCP Relay Agent Information Option 82 Policy : Replace DHCP Relay Agent Information Option 82 Remote ID : "00-1E-58-6F-03-40" Interface Server 1 Server 2 Server 3 Server 4 ------------ --------------- --------------- --------------- -------------- System 10.0.0.1 dhcpd.conf: ddns-update-style none; default-lease-time 600; max-lease-time 7200; log-facility local7; authoritative; allow unknown-clients; lease-file-name "/var/db/dhcpd.leases"; one-lease-per-client true; deny duplicates; if exists agent.remote-id and exists agent.circuit-id { if binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)) = "0" { set switch-mac = concat("0", binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)), ":", binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 3, 6))); } else { set switch-mac = binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 2, 6)); } set switch-addr = binary-to-ascii(10, 8, ".", packet(24, 4)); set switch-port = binary-to-ascii(10, 8, "", substring(option agent.circuit-id, 5, 1)); set switch-port-vlan = binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2)); log (info, concat("- Lease: ", binary-to-ascii(10, 8, ".", leased-address), " via IP: ", switch-addr, " (MAC: ", switch-mac, ") on port: ", switch-port, " in VLAN: ", switch-port-vlan)); } shared-network dlink { subnet 10.0.0.0 netmask 255.255.255.0 { range 10.0.0.2 10.0.0.90; option broadcast-address 10.0.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.0.0.1,8.8.8.8; option routers 10.0.0.1; } subnet 10.20.0.0 netmask 255.255.255.0 { option broadcast-address 10.20.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.20.0.1,8.8.8.8; option routers 10.20.0.1; class "port22" { match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "22" and binary-to-ascii(10, 8, ".", packet(24, 4)) = "10.0.0.101"; } # собственно выдаем IP классу pool { range 10.20.0.22; allow members of "port22"; } } } cat /var/log/messages Sep 7 13:52:43 Server dhcpd: - Lease: 10.0.0.11 via IP: 0.0.0.0 (MAC: 30:30:2d:31:45:2d) on port: 22 in VLAN: 2 Sep 7 13:52:43 Server dhcpd: DHCPREQUEST for 10.0.0.11 from 1c:af:f7:37:8e:4f (DIR-300) via eth1.2 Sep 7 13:52:43 Server dhcpd: DHCPACK on 10.0.0.11 to 1c:af:f7:37:8e:4f (DIR-300) via eth1.2 Т.е. как видно из лога, влан с портом определяется нормально, но почему тогда ip выдается из левого пула, где накосячино? Полный лог: Sep 7 13:45:55 Server dhcpd: DHCPACK on 10.0.0.11 to 1c:af:f7:37:8e:4f (DIR-300) via 10.0.0.101 Sep 7 13:46:45 Server dhcpd: - Lease: 10.0.0.13 via IP: 10.0.0.101 (MAC: 30:30:2d:31:45:2d) on port: 22 in VLAN: 2 Sep 7 13:46:45 Server dhcpd: DHCPDISCOVER from f0:7d:68:5b:8c:67 via 10.0.0.101 Sep 7 13:46:46 Server dhcpd: DHCPOFFER on 10.0.0.13 to f0:7d:68:5b:8c:67 (DIR-300) via 10.0.0.101 Sep 7 13:46:46 Server dhcpd: - Lease: 10.0.0.13 via IP: 10.0.0.101 (MAC: 30:30:2d:31:45:2d) on port: 22 in VLAN: 2 Sep 7 13:46:46 Server dhcpd: DHCPREQUEST for 10.0.0.13 (10.0.0.1) from f0:7d:68:5b:8c:67 (DIR-300) via 10.0.0.101
  8. Ну да, так и есть, если учесть данный пример. В принципе тут уже и БЕЗ понимания расчета ethernet маски уже жить можно :) Правило 1: если МАС-адрес источника SourceMAC равен МАС-адресам ПК-1 или ПК-2 –разрешить (Permit). create access_profile ethernet source_mac FF-FF-FF-FF-FF-FF profile_id 1 profile_name Permit_Internet config access_profile profile_id 1 add access_id 1 ethernet source_mac 00-50-ba-11-11-11 port 1 permit config access_profile profile_id 1 add access_id 2 ethernet source_mac 00-50-ba-22-22-22 port 10 permit Правило 2: если МАС-адрес назначения DestMAC равен MAC-адресу Интернет-шлюза – запретить (Deny). create access_profile ethernet destination_mac FF-FF-FF-FF-FF-FF profile_id 2 profile_name Deny_Internet config access_profile profile_id 2 add access_id 1 ethernet destination_mac 00-50-ba-99-99-99 port 11 deny
  9. Дык читаю, дословно: Маска профиля доступа определяет, какие биты в значениях полей IP-адрес, МАС-адрес, порт ТСР/UDP и т.д. приходящих на коммутатор пакетов, должны проверяться, а какие игнорироваться. Биты маски имеют следующие значения: «0» – означает игнорирование значения соответствующего бита поля пакета; «1» – означает проверку значения соответствующего бита поля пакета. Предположим, администратору сети необходимо запретить прохождение трафика от узла с МАС-адресом 01-00-00-00-АС-11. Маска профиля доступа для этого адреса будет равна FF-FF-FF-FF-FF-FF.
  10. так, с этим понятно, а как быть если требуется создать маску профиля для мак? Например маска профиля 01-00-00-00-AC-11 будет равна FF-FF-FF-FF-FF-FF почему?
  11. все равно не понимаю, возьмем расчет из примера по ссылке http://www.dlink.ru/ru/faq/62/201.html начальное 16384 (дес.) = 01|00 0000 0000 0000 конечное 32767 (дес.) = 01|11 1111 1111 1111 маска 11|00 0000 0000 0000 (двоич.) = 0xC000 (шестн.) закроет диапазон (в точности требуемый) от 01|00 0000 0000 0000 как у них получилось 11|00 0000 0000 0000 ? прикол по теме )))) 16384+32767=49151,причем если 49151+1=49152=0xC000 (calc.exe)
  12. Спасибо! Но не хочу дальше напрягать если к примеру потребуется мне закрыть еще что-будь. В общем хочу разобраться, поясните как получилась маска 0xFFFF ? 0xFFFF(hex)=1111000000000000(bin)=61440(dec) т.е. получается эта маска подходит под любой из 61440 портов и ее можно для любого ip acl профиля указывать? И как считать дальше т.н. ip_mask?
  13. В общем пишу acl на 21, 22 и 80 порты. Задача закрыть их с определенных портов коммутатора. В общем практически то что написано здесь http://www.dlink.ru/ru/faq/62/201.html и http://www.dlink.ru/ru/faq/62/print_209.html Реально едет крыша, сижу тупо 3-й час и не въезжаю как это делается. Объясните почеловечески или на худой конец ткните в калькулятор для расчета этих гребаных масок!
  14. Ок, давайте сделаем группу fixedport. Например: tag-if=set:fixedport,tag:switch1,tag:port2 dhcp-range=net:#fixedport,10.10.40.50,10.10.40.60,255.255.255.0 dhcp-option=net:#fixedport,option:router,10.0.0.100 dhcp-option=net:#fixedport,option:dns-server,8.8.8.8 dhcp-remoteid=set:switch1,00:1e:58:aa:b3:ad dhcp-circuitid=set:port2,01:06:00:04:00:01:00:02 В этом случае шлюз и dns-ы отдает клиенту, одако ip-шник выдает из дефолтного 10.0.0.0/24. И как я и писал, подозрение на строку описания порта, в данном случае #2. Мутатор отдает Agent Circuit ID: 000400010002 Я пробовал и так: dhcp-circuitid=set:port2,01:06:00:04:00:01:00:02 и так: dhcp-circuitid=set:port2,0106000400010002 и так: dhcp-circuitid=set:port2,000400010002 и так: dhcp-circuitid=set:port2,00:04:00:01:00:02 и я уже хз че ему надо В мане буквально следующее: --dhcp-circuitid=set:<tag>,<circuit-id>, --dhcp-remoteid=set:<tag>,<remote-id> Map from RFC3046 relay agent options to tags. This data may be provided by DHCP relay agents. The circuit-id or remote-id is normally given as colon-separated hex, but is also allowed to be a simple string. If an exact match is achieved between the circuit or agent ID and one provided by a relay agent, the tag is set. Лог самого dnsmasq: Apr 26 10:19:46 Server dnsmasq-dhcp[14838]: 2733913276 sent size: 18 option: 82:agent-id 01:06:00:04:00:01:00:02:02:08:00:06:00... Где грабли?
  15. Собственно, впрервые настраиваю, может кто сталкивался DES-3028 настроен с вкл. option 82 и вроде даже вставляет ее в dhcp запрос, что видно по логу wireshark: 91 44.406940 10.0.0.100 10.0.0.1 DHCP DHCP Request - Transaction ID 0x3b866793 Option: (t=82,l=18) Agent Information Option Option: (82) Agent Information Option Length: 18 Value: 010600040001000202080006001e58aab3ad Agent Circuit ID: 000400010002 Agent Remote ID: 0006001e58aab3ad End Option При этом, что происходит в Dnsmasq: Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 available DHCP range: 10.0.0.2 -- 10.0.0.150 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 client provides name: artyom Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 vendor class: MSFT 5.0 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 DHCPREQUEST(eth1) 10.0.0.133 00:0a:e4:33:3c:97 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 DHCPACK(eth1) 10.0.0.133 00:0a:e4:33:3c:97 artyom Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 requested options: 1:netmask, 15:domain-name, 3:router, 6:dns-server, Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 requested options: 44:netbios-ns, 46:netbios-nodetype, 47:netbios-scope, Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 requested options: 31:router-discovery, 33:static-route, 249, Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 requested options: 43:vendor-encap Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 tags: eth1 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 next server: 10.0.0.1 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 1 option: 53:message-type 05 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 4 option: 54:server-identifier 10.0.0.1 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 4 option: 51:lease-time 00:00:a8:c0 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 4 option: 58:T1 00:00:4b:05 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 4 option: 59:T2 00:00:8a:4d Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 4 option: 1:netmask 255.255.255.0 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 4 option: 28:broadcast 10.0.0.255 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 4 option: 3:router 10.0.0.100 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 9 option: 81:FQDN 03:ff:ff:61:72:74:79:6f:6d Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 8 option: 6:dns-server 10.0.0.1, 8.8.8.8 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 7 option: 43:vendor-encap 06:04:01:01:01:01:ff Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 8 option: 60:vendor-class 4d:53:46:54:20:35:2e:30 Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 18 option: 82:agent-id 01:06:00:04:00:01:00:02:02:08:00:06:00... Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 available DHCP range: 10.0.0.2 -- 10.0.0.150 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 client provides name: artyom Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 vendor class: MSFT 5.0 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 DHCPREQUEST(eth1) 10.0.0.133 00:0a:e4:33:3c:97 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 DHCPACK(eth1) 10.0.0.133 00:0a:e4:33:3c:97 artyom Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 requested options: 1:netmask, 15:domain-name, 3:router, 6:dns-server, Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 requested options: 44:netbios-ns, 46:netbios-nodetype, 47:netbios-scope, Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 requested options: 31:router-discovery, 33:static-route, 249, Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 requested options: 43:vendor-encap Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 tags: eth1 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 next server: 10.0.0.1 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 1 option: 53:message-type 05 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 4 option: 54:server-identifier 10.0.0.1 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 4 option: 51:lease-time 00:00:a8:c0 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 4 option: 58:T1 00:00:4c:8d Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 4 option: 59:T2 00:00:8b:d5 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 4 option: 1:netmask 255.255.255.0 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 4 option: 28:broadcast 10.0.0.255 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 4 option: 3:router 10.0.0.1 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 9 option: 81:FQDN 03:ff:ff:61:72:74:79:6f:6d Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 8 option: 6:dns-server 10.0.0.1, 8.8.8.8 Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 7 option: 43:vendor-encap 06:04:01:01:01:01:ff Apr 25 11:29:38 Server dnsmasq-dhcp[25986]: 54831025 sent size: 8 option: 60:vendor-class 4d:53:46:54:20:35:2e:30 Как понимать эту строчку? Apr 25 11:29:36 Server dnsmasq-dhcp[25986]: 1391247347 sent size: 18 option: 82:agent-id 01:06:00:04:00:01:00:02:02:08:00:06:00... В конфиге dnsmasq по поводу настройки option 82 следующее: dhcp-remoteid=set:switch1,00:1E:58:AA:B3:AD dhcp-circuitid=set:port-3,3 dhcp-range=net:switch1,net:port-3,10.10.35.2,10.10.35.5,255.255.255.0 В общем непонятки по поводу dhcp-circuitid, как она должна выглядеть в конфиге?