Настройка коммутатора D-Link DGS-3120

Для примера возьму DGS-3120-24SC с прошивкой 3.00.B026.

Настройка уведомлений от датчиков:

config temperature threshold high 79
config temperature threshold low 11
config temperature trap state enable
config temperature log state enable
config fan trap state enable
config power trap state enable

Добавление аккаунта администратора:

create account admin ИМЯ ПАРОЛЬ

Включение хранения паролей в шифрованном виде:

enable password encryption

Настройка авто выхода при подключении через консольный порт:

config serial_port auto_logout never

Включение веб интерфейса:

enable web 80

Включение отображения информации в консоли в постраничном режиме:

enable clipaging

Ширина консольной строки:

config terminal width 80

Отключение сохранения истории введенных команд:

disable command logging

Включение возможности восстановления пароля:

enable password_recovery

Отключение trap уведомлений при манипуляциях с конфигурацией:

config configuration trap save disable
config configuration trap upload disable
config configuration trap download disable

debug config state enable
debug config error_reboot enable

Настройка контроля трафика:

config traffic control 1:1-1:24 broadcast enable multicast disable unicast disable action drop broadcast_threshold 100 multicast_threshold 131072 unicast_threshold 131072 countdown 5 time_interval 5
config traffic control auto_recover_time 0
config traffic trap none
config traffic control log state enable

Включение защиты от петель на портах, кроме входящего девятого:

enable loopdetect
config loopdetect recover_timer 600 interval 10 mode port-based
config loopdetect log state enable
config loopdetect ports 1:1 state enable
config loopdetect ports 1:2 state enable
config loopdetect ports 1:3 state enable
config loopdetect ports 1:4 state enable
config loopdetect ports 1:5 state enable
config loopdetect ports 1:6 state enable
config loopdetect ports 1:7 state enable
config loopdetect ports 1:8 state enable
config loopdetect ports 1:9 state disable
config loopdetect ports 1:10 state enable
config loopdetect ports 1:11 state enable
config loopdetect ports 1:12 state enable
config loopdetect ports 1:13 state enable
config loopdetect ports 1:14 state enable
config loopdetect ports 1:15 state enable
config loopdetect ports 1:16 state enable
config loopdetect ports 1:17 state enable
config loopdetect ports 1:18 state enable
config loopdetect ports 1:19 state enable
config loopdetect ports 1:20 state enable
config loopdetect ports 1:21 state enable
config loopdetect ports 1:22 state enable
config loopdetect ports 1:23 state enable
config loopdetect ports 1:24 state enable
config loopdetect trap none

Отключение функции зеркалирования трафика:

disable mirror

Настройки логов:

config log_save_timing on_demand
disable syslog
config system_severity trap notice
config system_severity log information

Сегментация трафика (запрет хождения трафика меду портами, входящим портом указан девятый):

config traffic_segmentation 1:1-1:8,1:10-1:24 forward_list 1:9
config traffic_segmentation 1:9 forward_list 1:1-1:8,1:10-1:24

Разрешение на использование больших пакетов:

enable jumbo_frame

Пример настройки портов:

config ports 1:1 medium_type copper speed auto  flow_control disable learning enable state enable mdix auto description Kvartiru
config ports 1:1-1:8 medium_type fiber speed auto   flow_control disable learning enable state enable
config ports 1:2 medium_type copper speed auto  flow_control disable learning enable state enable mdix auto description BAT
config ports 1:3-1:7 medium_type copper speed auto  flow_control disable learning enable state enable mdix auto
config ports 1:8 medium_type copper speed auto  flow_control disable learning enable state enable mdix auto description Studentu
config ports 1:9 speed auto   flow_control disable learning enable state enable mdix auto description VHOD
config ports 1:10 speed auto   flow_control disable learning enable state enable mdix auto description Zheleznodorozhnaya
config ports 1:11-1:24 speed auto   flow_control disable learning enable state enable mdix auto

Разрешаем доступ к коммутатору только с указанных адресов:

create trusted_host network 10.0.0.100/32 snmp telnet ssh http https ping
create trusted_host network 172.16.0.0/24 snmp telnet ssh http https ping

Настройки SNMP:

disable snmp traps
disable snmp authenticate_traps
disable snmp linkchange_traps
enable snmp
config snmp system_name DGS-3120-24SC
config snmp system_location текст
config snmp linkchange_traps ports 1:1-1:24 enable
config snmp coldstart_traps disable
config snmp warmstart_traps disable
config rmon trap rising_alarm enable
config rmon trap falling_alarm enable
delete snmp community public
delete snmp community private
create snmp community новый_snmp_пароль view CommunityView read_only
disable community_encryption

Пример настройки VLAN:

disable pvid auto_assign
config vlan default delete 1:1-1:24
config vlan default advertisement enable
create vlan core tag 207
config vlan core add tagged 1:8-1:13,1:15-1:16,1:18-1:20,1:22-1:24
config vlan core add forbidden 1:1-1:7 advertisement disable
create vlan local_smart tag 226
config vlan local_smart add tagged 1:9-1:13,1:15-1:16,1:18-1:20,1:22-1:24
config vlan local_smart add untagged 1:1-1:7,1:14,1:17,1:21 advertisement disable
create vlan local_smart2 tag 227
config vlan local_smart2 add tagged 1:8-1:9 advertisement disable
create vlan hpna tag 228
config vlan hpna add tagged 1:9,1:12 advertisement disable
create vlan multicast tag 229
config vlan multicast advertisement disable
create vlan lift tag 300
config vlan lift add tagged 1:9,1:11,1:13 advertisement disable
disable gvrp
disable asymmetric_vlan
disable vlan_trunk
config port_vlan 1:1-1:7,1:9-1:24 gvrp_state disable ingress_checking enable acceptable_frame admit_all pvid 226
config port_vlan 1:8 gvrp_state disable ingress_checking enable acceptable_frame admit_all pvid 227

Стандартные настройки PORT_SECURITY:

config port_security system max_learning_addr no_limit
config port_security trap state disable
config port_security log state disable
config port_security ports 1:1-1:24 admin_state disable max_learning_addr 32 action drop lock_address_mode deleteonreset

Приведу пример блокировки mac адреса через ACL правила:

create access_profile profile_id 1 profile_name tank34 ethernet source_mac FF-FF-FF-FF-FF-FF
config access_profile profile_id 1 add access_id 1 ethernet source_mac E8-9A-8F-BB-F8-44 vlan_based vlan_id 226 deny
config access_profile profile_id 1 add access_id auto_assign ethernet source_mac F8-1A-67-FE-E7-00 port 1:24 deny
config access_profile profile_id 1 add access_id auto_assign ethernet source_mac F8-1A-67-FE-E7-00 vlan_based vlan_id 226 deny

PowerSaving

config power_saving mode link_detection enable
config power_saving mode length_detection disable
config power_saving mode hibernation disable
config power_saving mode led disable
config power_saving mode port disable

LED-CTRL

config led state enable

Время хранения MAC адресов в таблице маршрутизатора в секундах:

config fdb aging_time 300

Фильтрация NetBios (блокировка доступа к расшареным ресурсам пользователей):

config filter netbios all state disable
config filter netbios 1:1-1:24 state enable
config filter extensive_netbios all state disable

Настройка защиты от DoS атак:

config dos_prevention dos_type land_attack action drop state enable
config dos_prevention dos_type blat_attack action drop state enable
config dos_prevention dos_type tcp_null_scan action drop state enable
config dos_prevention dos_type tcp_xmasscan action drop state enable
config dos_prevention dos_type tcp_synfin action drop state enable
config dos_prevention dos_type tcp_syn_srcport_less_1024 action drop state enable
config dos_prevention dos_type ping_death_attack action drop state enable
config dos_prevention dos_type tcp_tiny_frag_attack action drop state enable
config dos_prevention trap disable
config dos_prevention log disable

Разрешаем ответы от DHCP серверов только с входящего порта, тем самым блокируя чужие:

config filter dhcp_server ports all state disable
config filter dhcp_server ports 1:1-1:8,1:10-1:24 state enable
config filter dhcp_server illegal_server_log_suppress_duration 30min
config filter dhcp_server trap disable
config filter dhcp_server log enable

Настройка BPDU защиты:

enable bpdu_protection
config bpdu_protection recovery_timer 3000
config bpdu_protection log none
config bpdu_protection ports 1:1-1:8,1:10-1:24 state enable
config bpdu_protection ports 1:1-1:24 mode drop

Настройка самозащиты коммутатора «SAFEGUARD ENGINE»:

config safeguard_engine state enable utilization rising 100 falling 93 trap_log enable mode fuzzy

Стандартные параметры SSH:

config ssh algorithm 3DES enable
config ssh algorithm AES128 enable
config ssh algorithm AES192 enable
config ssh algorithm AES256 enable
config ssh algorithm arcfour enable
config ssh algorithm blowfish enable
config ssh algorithm cast128 enable
config ssh algorithm twofish128 enable
config ssh algorithm twofish192 enable
config ssh algorithm twofish256 enable
config ssh algorithm MD5 enable
config ssh algorithm SHA1 enable
config ssh algorithm RSA enable
config ssh algorithm DSA enable
config ssh authmode password enable
config ssh authmode publickey enable
config ssh authmode hostbased enable
config ssh server maxsession 8
config ssh server contimeout 120
config ssh server authfail 2
config ssh server rekey never
config ssh server port 22
config ssh user ИМЯ authmode password
config ssh publickey bypass_login_screen state disable
disable ssh

Включение telnet службы:

enable telnet 23

SMTP

disable smtp
config smtp server_port 25

Настройка параметров времени SNTP:

enable sntp
config time_zone operator + hour 2 min 0
config sntp primary 192.168.1.1 poll-interval 31720
config dst disable

LACP

config link_aggregation algorithm mac_source
config lacp_port 1:1-1:24 mode passive

IP

config ipif_mac_mapping ipif System mac_offset 0
config ipif System ipaddress 10.0.0.235/24 vlan core
config ipif System dhcpv6_client disable
config ipif System proxy_arp disable local disable
config ipif System dhcp_option12 state disable
disable autoconfig

Отключение DHCP Relay

disable dhcp_relay
disable dhcpv6_relay

ARP

config arp_aging time 20
config gratuitous_arp send ipif_status_up disable
config gratuitous_arp send dup_ip_detected disable
config gratuitous_arp learning disable

Настройка основного маршрута:

create iproute default 192.168.1.1 1 primary

Сохранение конфигурации:

save all

Оставьте комментарий

Добавить комментарий

Больше на IT Blog

Оформите подписку, чтобы продолжить чтение и получить доступ к полному архиву.

Continue reading