DMZ

Материал из xapmc.net
Перейти к: навигация, поиск
Задача
Разграничить сети на зоны. Настроить доступ между зонами. Из зоны trust сделать доступ в зону DMZ только для трафика http(80 порт).
Решение
Воспользуемся для построения зон juniper srx 100.
Оборудование, которым располагаем
Вендор Модель
1. juniper srx100
Схема сети

DMZ juniper srx100 ip.png

Настройка
Добавим интерфейс fe-0/0/0 в зону untrust. так как интерфейс получает настройки по dhcp, сделаем исключения для dhcp и tftp.
set interfaces fe-0/0/0 unit 0 family inet dhcp
set security zones security-zone untrust interfaces fe-0/0/0.0 host-inbound-traffic system-services dhcp
set security zones security-zone untrust interfaces fe-0/0/0.0 host-inbound-traffic system-services tftp
Создадим vlans. Они будут маршрутизированные.
set vlans vlan34 vlan-id 34
set vlans vlan34 l3-interface vlan.34
set vlans vlan35 vlan-id 35
set vlans vlan35 l3-interface vlan.35
Добавим vlans на соответствующие порты.
set interfaces fe-0/0/2 unit 0 family ethernet-switching vlan members vlan35
set interfaces fe-0/0/4 unit 0 family ethernet-switching vlan members vlan34
Добавим шлюзы для маршрутизации между сетями.
set interfaces vlan unit 34 family inet address 192.168.34.1/24
set interfaces vlan unit 35 family inet address 192.168.35.1/24
Добавим vlan.35 и fe-0/0/2 в зону trust.
set security zones security-zone trust interfaces vlan.35
set security zones security-zone trust interfaces fe-0/0/2
Добавим vlan.34 и fe-0/0/4 в зону DMZ.
set security zones security-zone DMZ interfaces vlan.34 host-inbound-traffic system-services all
set security zones security-zone DMZ interfaces fe-0/0/4 host-inbound-traffic system-services all
Создадим address book для адреса 192.168.35.2.
set security zones security-zone trust address-book address client-trust 192.168.35.2/32
Создадим address book для адреса 192.168.34.22.
set security zones security-zone DMZ address-book address www-server 192.168.34.22/32
Создадим address book группу.
set security zones security-zone DMZ address-book address-set dmz-servers address www-server
Разрешим http трафик внутри зоны DMZ.
set security policies from-zone DMZ to-zone DMZ policy permit-ser-in-DMZ match source-address dmz-servers
set security policies from-zone DMZ to-zone DMZ policy permit-ser-in-DMZ match destination-address dmz-servers
set security policies from-zone DMZ to-zone DMZ policy permit-ser-in-DMZ match application junos-http
set security policies from-zone DMZ to-zone DMZ policy permit-ser-in-DMZ then permit
Разрешим любой трафик из зоны trust в untrust.
set security policies from-zone trust to-zone untrust policy trust-to-untrust match source-address any
set security policies from-zone trust to-zone untrust policy trust-to-untrust match destination-address any
set security policies from-zone trust to-zone untrust policy trust-to-untrust match application any
set security policies from-zone trust to-zone untrust policy trust-to-untrust then permit
Разрешим прохождение трафика из зоны trust клиента 192.168.35.2 в зону DMZ на адрес 192.168.34.22 по порту 80.
set security policies from-zone trust to-zone DMZ policy permit-www-trust-DMZ match source-address client-trust
set security policies from-zone trust to-zone DMZ policy permit-www-trust-DMZ match destination-address www-server
set security policies from-zone trust to-zone DMZ policy permit-www-trust-DMZ match application junos-http
set security policies from-zone trust to-zone DMZ policy permit-www-trust-DMZ then permit
Разрешим прохождение любого трафика внутри зоны trust.
set security policies from-zone trust to-zone trust policy trust-to-trust match source-address any
set security policies from-zone trust to-zone trust policy trust-to-trust match destination-address any
set security policies from-zone trust to-zone trust policy trust-to-trust match application any
set security policies from-zone trust to-zone trust policy trust-to-trust then permit
После всех этих настроек трафик только от клиента 192.168.35.2 из зоны trust по порту 80 может проходить в зону DMZ только на адрес 192.168.34.22.
Задача решена.