Konfigurasi ini dilakukan dengan simulasi sistem operasi virtual. Perangkat lunak yang digunakan adalah sebagai berikut:
Topologi logik yang dibangun ditunjukkan pada gambar berikut:
Tujuan simulasi yang ingin dicapai:
- Konfigurasi antarmuka jaringan dan alamat IP pada semua sistem sesuai topologi.
- Konfigurasi dinding api global stateful pada Vyatta Core.
- Konfigurasi dinding api berbasis zona (zone-based firewall) pada Vyatta Core. Zona yang dikonfigurasi adalah zona Lokal (Local-Zone), zona Outside (eth0), zona Inside (eth1) dan zona DMZ (eth2). Kebijakan lalu lintas data antar zona adalah sebagai berikut:
- Dari zona Lokal ke zona Outside/zona Inside/zona DMZ: accept
- Dari zona Outside/zona Inside/zona DMZ ke zona Lokal: drop kecuali SSH dan ICMP accept.
- Dari zona Outside ke zona Inside: drop.
- Dari zona Outside ke zona DMZ: drop kecuali SSH dan HTTP ke Debian-DMZ accept.
- Dari zona Inside ke zona Outside/zona DMZ: accept
- Dari zona DMZ ke zona Outside: accept
- Dari zona DMZ ke zona Inside: drop
- Konfigurasi SNAT Masquerade (PAT) pada Vyatta Core untuk lalu lintas data dari BlankOn-Inside menuju zona Outside dan zona DMZ.
- Konfigurasi NAT dua arah (bidirectional NAT) pada Vyatta Core untuk lalu lintas data dari zona Outside menuju Debian-DMZ dan kebalikannya.
firewall {
all-ping enable
broadcast-ping disable
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians enable
name DMZ_TO_INSIDE {
default-action drop
}
name DMZ_TO_LOCAL {
default-action drop
rule 1 {
action accept
destination {
port ssh
}
protocol tcp
}
rule 2 {
action accept
protocol icmp
}
}
name DMZ_TO_OUTSIDE {
default-action accept
}
name INSIDE_TO_DMZ {
default-action accept
}
name INSIDE_TO_LOCAL {
default-action drop
rule 1 {
action accept
destination {
port ssh
}
protocol tcp
}
rule 2 {
action accept
protocol icmp
}
}
name INSIDE_TO_OUTSIDE {
default-action accept
}
name LOCAL_TO_DMZ {
default-action accept
}
name LOCAL_TO_INSIDE {
default-action accept
}
name LOCAL_TO_OUTSIDE {
default-action accept
}
name OUTSIDE_TO_DMZ {
default-action drop
rule 1 {
action accept
destination {
address 172.16.0.10
port ssh,http
}
protocol tcp
}
}
name OUTSIDE_TO_INSIDE {
default-action drop
}
name OUTSIDE_TO_LOCAL {
default-action drop
rule 1 {
action accept
destination {
port ssh
}
protocol tcp
}
rule 2 {
action accept
protocol icmp
}
}
receive-redirects disable
send-redirects enable
source-validation disable
state-policy {
established {
action accept
}
invalid {
action drop
log {
enable
}
}
related {
action accept
}
}
syn-cookies enable
}
interfaces {
ethernet eth0 {
address 10.0.0.2/24
address 10.0.0.10/24
description "antarmuka OUTSIDE"
duplex auto
hw-id 08:00:27:94:27:df
smp_affinity auto
speed auto
}
ethernet eth1 {
address 192.168.0.1/24
description "antarmuka INSIDE"
duplex auto
hw-id 08:00:27:e6:88:61
smp_affinity auto
speed auto
}
ethernet eth2 {
address 172.16.0.1/24
description "antarmuka DMZ"
duplex auto
hw-id 08:00:27:68:de:ac
smp_affinity auto
speed auto
}
loopback lo {
}
}
nat {
destination {
rule 3 {
description "DNAT dari zona OUTSIDE ke Debian-DMZ"
destination {
address 10.0.0.10
}
inbound-interface eth0
translation {
address 172.16.0.10
}
}
}
source {
rule 1 {
description "SNAT Masquerade dari zona INSIDE ke zona OUTSIDE"
outbound-interface eth0
source {
address 192.168.0.0/24
}
translation {
address masquerade
}
}
rule 2 {
description "SNAT Masquerade dari zona INSIDE ke zona DMZ"
outbound-interface eth2
source {
address 192.168.0.0/24
}
translation {
address masquerade
}
}
rule 3 {
description "SNAT dari Debian-DMZ ke zona OUTSIDE"
outbound-interface eth0
source {
address 172.16.0.10
}
translation {
address 10.0.0.10
}
}
}
}
protocols {
static {
route 0.0.0.0/0 {
next-hop 10.0.0.1 {
}
}
}
}
service {
ssh {
port 22
}
}
system {
config-management {
commit-revisions 100
}
host-name vyatta-core
login {
banner {
pre-login ""
}
user utian {
authentication {
encrypted-password $1$xfieuOG9$71yatduWgwVlWf.XzHbmr/
}
level admin
}
}
ntp {
server 0.vyatta.pool.ntp.org {
}
server 1.vyatta.pool.ntp.org {
}
server 2.vyatta.pool.ntp.org {
}
}
package {
auto-sync 1
repository community {
components main
distribution stable
password ""
url http://packages.vyatta.com/vyatta
username ""
}
}
syslog {
global {
facility all {
level notice
}
facility protocols {
level debug
}
}
}
time-zone GMT
}
zone-policy {
zone DMZ {
default-action drop
from INSIDE {
firewall {
name INSIDE_TO_DMZ
}
}
from LOCAL {
firewall {
name LOCAL_TO_DMZ
}
}
from OUTSIDE {
firewall {
name OUTSIDE_TO_DMZ
}
}
interface eth2
}
zone INSIDE {
default-action drop
from DMZ {
firewall {
name DMZ_TO_INSIDE
}
}
from LOCAL {
firewall {
name LOCAL_TO_INSIDE
}
}
from OUTSIDE {
firewall {
name OUTSIDE_TO_INSIDE
}
}
interface eth1
}
zone LOCAL {
default-action drop
from DMZ {
firewall {
name DMZ_TO_LOCAL
}
}
from INSIDE {
firewall {
name INSIDE_TO_LOCAL
}
}
from OUTSIDE {
firewall {
name OUTSIDE_TO_LOCAL
}
}
local-zone
}
zone OUTSIDE {
default-action drop
from DMZ {
firewall {
name DMZ_TO_OUTSIDE
}
}
from INSIDE {
firewall {
name INSIDE_TO_OUTSIDE
}
}
from LOCAL {
firewall {
name LOCAL_TO_OUTSIDE
}
}
interface eth0
}
}