URL: https://www.opennet.me/cgi-bin/openforum/vsluhboard.cgi
Форум: vsluhforumID1
Нить номер: 96130
[ Назад ]

Исходное сообщение
"PF FreeBSD два ISP два VLAN "

Отправлено isvd , 12-Май-15 14:12 
Помогите пожалуйста натировать трафик с одного vlan8 в IPS1 а с vlan6-13 в ISP2.
Вроде читаю и делаю но ничего не получаеться.

тут читал
http://dreamcatcher.ru/2009/12/28/   pf-Часть-2-Расширенная-конфигурация

получалось только так

ext_if1 = "igb0"
ext_if2 = "vlan4"
ext_gw1 = "26.74.250.1"
ext_gw2 = "6.38.18.1"

set limit states 16000000
set optimization aggressive
set limit src-nodes 160000
set limit table-entries 160000
nat-anchor "ftp-proxy/*"


nat on $ext_if1 from 10.8.0.0/20 to any -> $ext_if2  (клиенты под сети жалуются на пинг)
nat on $ext_if1 from 10.0.0.0/8 to any -> $ext_if1

#  route packets from any IPs on $ext_if1 to $ext_gw1 and the same for $ext_if2 and $ext_gw2
pass out on $ext_if1 route-to ($ext_if2 $ext_gw2) from $ext_if2 to any
pass out on $ext_if2 route-to ($ext_if1 $ext_gw1) from $ext_if1 to any


10.8 улетает на isp2

10.6
10.11
10.13  на isp1

мне нужно грубо раскидать вланы по каналам.


Содержание

Сообщения в этом обсуждении
"PF FreeBSD два ISP два VLAN "
Отправлено isvd , 12-Май-15 15:42 
вроде так работает. прокоментируйте.


ext_if1 = "igb0"
ext_if2 = "vlan4"
ext_gw1 = "xx.xx.250.1"
ext_gw2 = "xx.xx.18.1"
lan_net = "10.0.0.0/8"


set limit states 16000000
set optimization aggressive
set limit src-nodes 160000
set limit table-entries 160000
nat-anchor "ftp-proxy/*"


nat on $ext_if1 from 10.6.0.0/20 to any -> $ext_if1
nat on $ext_if1 from 10.11.0.0/20 to any -> $ext_if1
nat on $ext_if1 from 10.13.0.0/20 to any -> $ext_if1
nat on $ext_if1 from 10.18.0.0/20 to any -> $ext_if1

nat on $ext_if2 from 10.8.0.0/20 to any -> $ext_if2

#проброс без балансировки (согласно списку адресов)
pass in quick on vlan6 route-to ($ext_if1 $ext_gw1) from 10.6.0.0/20 to !$lan_net keep state
pass in quick on vlan8 route-to ($ext_if2 $ext_gw2) from 10.8.0.0/20 to !$lan_net keep state
pass in quick on vlan11 route-to ($ext_if1 $ext_gw1) from 10.11.0.0/20 to !$lan_net keep state
pass in quick on vlan13 route-to ($ext_if1 $ext_gw1) from 10.13.0.0/20 to !$lan_net keep state
pass in quick on vlan18 route-to ($ext_if1 $ext_gw1) from 10.18.0.0/20 to !$lan_net keep state


# general "pass out" rules for external interfaces
pass out on $ext_if1 proto tcp from any to any flags S/SA modulate state
pass out on $ext_if1 proto { udp, icmp } from any to any keep state
pass out on $ext_if2 proto tcp from any to any flags S/SA modulate state
pass out on $ext_if2 proto { udp, icmp } from any to any keep state

#  route packets from any IPs on $ext_if1 to $ext_gw1 and the same for $ext_if2 and $ext_gw2
pass out on $ext_if1 route-to ($ext_if2 $ext_gw2) from $ext_if2 to any
pass out on $ext_if2 route-to ($ext_if1 $ext_gw1) from $ext_if1 to any