Tue, 18 Sep 2012 15:47:02 +0300 tarihinde What you get is Not what you see <[email protected]> yazmış:
> Openbsd pf ile 2 internet hattini load balans yapmaya calisiyorum. 2
> ayri modem var, 3 nicli bir makinede pf calisiyor.
> Firewallda dhcp ve dns hizmetleri veriliyor.
> Her modem agi icin ayri ayri nat yapiyorum (boyle yapmali miyim?). Nat
> yapmadan bu firewall calisir mi?
> Asagidaki pf.conf dosyasinda hangi hatalar var soyleyebilir misiniz?
> Firewalldan giden paketler icin nasil kurallar yazabilirim? Ornek
> verebilir misiniz?
> Ayrica 5651 icin sanirim dhcp loglarini saklamam lazim. Bunu Openbsd
> de nasil yaparim?
>
> modem 1
> firewall |-----------------
> Ic ag----------------|
> |-----------------
> modem2
>
Yapmak itediğinizi aşağıdaki gibi pf kuralları yazarak yapabilirsiniz.
yapabilirsiniz. Eski bir sistemdeki "örnek" yapılandırmadır, pf imlası
değişik olabilir. Kendi gereksinmelerinze göre düzenlemeniz gerektiğini
tekrar anımsatayım. Aşağıdaki kurallar e-posta istemcisinin ayarları
gereği bazen ikinci satıra geçmektedir, okurken, yazarken dikkat! ;)
local_lan = "192.168.0.0/24"
internal_if = "fxp1"
internet_gw1 = "em0"
internet_gw2 = "fxp0"
# nat outgoing connections headed out both internet gateways
nat on $internet_gw1 from $local_lan to any -> ($internet_gw1)
nat on $internet_gw2 from $local_lan to any -> ($internet_gw2)
# set the default rule rule is deny
block in from any to any
block out from any to any
# pass all outgoing packets on internal interface
pass out on $internal_if from any to $local_lan
# pass in quick any packets destined for the lan gateway
pass in quick on $internal_if from $local_lan to $internal_if
# load balance outgoing tcp traffic from the internal network.
pass in on $internal_if route-to \
{ $internet_gw1, $internet_gw2 } round-robin \
proto tcp from $local_lan to any flags S/SA modulate state
# load balance outgoing udp and icmp traffic from the internal network
pass in on $internal_if route-to \
{ $internet_gw1, $internet_gw2 } round-robin \
proto { udp, icmp } from $local_lan to any keep state
# pass out rules for external interfaces
pass out on $internet_gw1 proto tcp from any to any flags S/SA modulate
state pass out on $internet_gw1 proto { udp, icmp } from any to any
keep state pass out on $internet_gw2 proto tcp from any to any flags
S/SA modulate state pass out on $internet_gw2 proto { udp, icmp } from
any to any keep state
# route packets from any IP addresses on $1 to $internet_gw1 and the
# same for $ext_if2 and $internet_gw2
pass out on $internet_gw1 route-to $internet_gw2 from $internet_gw2 to
any
pass out on $internet_gw2 route-to $internet_gw1 from $internet_gw1
to any
pf kurallarınızı yazdıktan sonra kontro ledin.
pfctl -vnf /etc/pf.conf
Eğer hata yoksa ve varsa eski kuralları kaldırıp yeni kuralları
etkinleştirin.
pfctl -F all -f /etc/pf.conf
calomel.org vs örnekleri doşulsuz şartsız kullanmayın. Kendi
gereksinmeleriniz size özgüdür. Başkasının yazdığı kurallar sizin
durumunuz için de geçerli değildir.
Kolay gelsin.
--
Gökşin Akdeniz <[email protected]>
pgpgBESAz1LGV.pgp
Description: PGP signature
_______________________________________________ Bsd mailing list [email protected] https://liste.linux.org.tr/mailman/listinfo/bsd
