Hi misc,
I have /etc/ip_list1 file containing some destinations.
format of /etc/ip_list1 is given below.
1.2.3.4
1.6.3.0/24
I want to route ALL DESTINATIONS listed in /etc/ip_list1 via wan1_gw. The
rest of trafficc , I want to route via wan2_gw .
I have enabled below things in sysctl.conf file (including multipath
routing)
net.inet.ip.forwarding=1 # 1=Permit forwarding (routing) of IPv4
packets
#net.inet.ip.mforwarding=1 # 1=Permit forwarding (routing) of IPv4
multicast packets
net.inet.ip.multipath=1 # 1=Enable IP multipath routing
net.inet.icmp.rediraccept=1 # 1=Accept ICMP redirects
my 2 gatewys
wan1_gw= "192.168.2.100"
wan2_gw= "192.168.1.1"
my hostname.xxx files like these.
my wan1 interface
# cat /etc/hostname.rl0
inet 192.168.2.35 255.255.255.0
!route add -mpath default 192.168.2.100
my wan2 interface
# cat /etc/hostname.rl1
inet 192.168.1.11 255.255.255.0
!route add -mpath default 192.168.1.1
my lan interface
# cat /etc/hostname.bge0
inet 192.168.100.208 255.255.255.0
my pf.conf file looks like this.
# macros
int_if="bge0"
wan1_if="rl0"
wan2_if="rl1"
lan_net="192.168.100.0/24"
#lan_net="192.168.101.0/24"
wan1_gw= "192.168.2.100"
wan2_gw= "192.168.1.1"
table <ip_list1> persist file "/etc/ip_list1"
# options
set block-policy return
set loginterface $wan1_if
set skip on lo
#THIS IS THE RULE TO ROUTE VIA WAN1_GW
pass out quick log from any to <ip_list1> route-to ($wan1_if $wan1_gw)
# match rules
match out on $wan1_if from $lan_net nat-to ($wan1_if)
match out on $wan2_if from $lan_net nat-to ($wan2_if)
# filter rules
block in log
#block out log
pass out quick log
antispoof quick for { lo $int_if }
pass in log inet proto icmp all icmp-type $icmp_types
I still can NOT traceroute to destinations in /etc/ip_list1 via wan1_gw and
the rest via wan2_gw
How to achive this goal?
--
cat /etc/motd
Thank you
Indunil Jayasooriya
http://www.theravadanet.net/
http://www.siyabas.lk/sinhala_how_to_install.html - Download Sinhala
Fonts