I tried to make a firewall configuration for Junos. I have a Juniper router, which separates internal network( 192.168.1.0/28 ) and external network( 192.168.2.0/29 ). Rules are fallowing:
1. allow traffic to 192.168.1.7 ports 80 and 443 from all hosts
2. allow ssh traffic to all the hosts in 192.168.1.0/28 from 192.168.2.1 and 192.168.2.2
3. allow from 192.168.2.1 to port 8319 on all the hosts in 192.168.1.0/28
4. allow traffic to all the hosts on port 443 and 5900 in 192.168.1.0/28 from 192.168.2.3 and 192.168.2.4
5. allow established TCP connections
6. allow Google DNS servers
7. discard everything else!
8. don't allow outgoing connection from 192.168.1.7 to 192.168.2.5 on all ports.
Should fallowing firewall configuration work:
firewall {
filter incoming_traffic {
term WWW {
from {
destination-address {
192.168.1.7/32;
}
protocol tcp;
destination-port [ 80 443 ];
}
then accept;
}
term SSH {
from {
source-address {
192.168.2.1/32;
192.168.2.2/32;
}
destination-address {
192.168.1.0/28;
}
protocol tcp;
destination-port 22;
}
then accept;
}
term 8319 {
from {
source-address {
192.168.2.1/32;
}
destination-address {
192.168.1.0/28;
}
protocol tcp;
destination-port 8319;
}
then accept;
}
term 443_5900 {
from {
source-address {
192.168.2.3/32;
192.168.2.4/32;
}
destination-address {
192.168.1.0/28;
}
protocol tcp;
destination-port [ 443 5900 ];
}
then accept;
}
term established {
from {
tcp-established;
}
then {
count established;
accept;
}
}
term DNS {
from {
source-address {
8.8.8.8/32;
8.8.4.4/32;
}
protocol udp;
source-port 53;
}
then {
count DNS;
accept;
}
}
term other {
then discard;
}
}
filter outgoing_traffic {
term 192.168.2.5 {
from {
source-address {
192.168.1.7;
}
destination-address {
192.168.2.5/32
}
then {
discard
}
}
}
}
Is this firewall configuration correct? Will it work(I still don't have a router to try this)?