ipfw - natd problem

yusuf özbilgin ozbilgin at hotmail.com
Sat Apr 24 11:35:05 UTC 2010


Hi,

I am trying to use 2 internet lines for load balance.

outgoing interfaces are: em0 and xl0
                                
                                   
--Local Interface ( rl0 / 192.168.0.1 ) -- | Freebsd  7.2 | --ISP 1 ---interface ( em0 ) IP: 192.168.3.1
                                                                              --ISP 2 ---interface ( xl0 )   IP: 192.168.4.1


Default Gateway: 192.168.3.2
ISP2 Gateway: 192.168.4.2

Below rules is working well.
00030 prob 0.500000 skipto 60 ip from any to any in recv rl0
00031 skipto 40 ip from any to any out xmit rl0 tagged 1
00032 skipto 60 ip from any to any out xmit rl0 tagged 2
00033 skipto 198 tag 1 ip from any to any in recv em0
00034 skipto 200 tag 2 ip from any to any in recv xl0
00040 setfib 0 ip from any to any via rl0 keep-state
00050 allow ip from any to any via rl0
00060 setfib 1 ip from any to any via rl0 keep-state
00070 allow ip from any to any via rl0
00198 nat 1 ip from any to any via em0
00200 nat 2 ip from any to any via xl0
10220 allow ip from any to any
65534 deny ip from any to any
65535 allow ip from any to any


But I want to use natd.

I deleted the rules 198

then I added

ipfw add 198 divert 8668 ip from any to any via em0


Still works well

but after deleted rule 200 and I added below rule

ipfw add 200 divert 8669 ip from any to any via xl0

Only it uses default interface. What can be the problem?



Second natd working and natd conf files are below.

/sbin/natd -f /etc/nat1.conf

/sbin/natd -f /etc/nat2.conf


------------------
nat1.conf
------------------

interface em0
dynamic yes
same_ports yes
use_sockets yes
port 8668
unregistered_only yes
log yes
punch_fw 1000:999

------------------
nat2.conf
------------------
interface xl0

port 8669


dynamic yes

same_ports yes

use_sockets yes

unregistered_only yes

log yes

punch_fw 1000:999    



Thanks.

Yusuf
 		 	   		  


More information about the freebsd-net mailing list