Forum Discussion

faycal_29095's avatar
faycal_29095
Icon for Nimbostratus rankNimbostratus
Dec 06, 2007

Using twi IRULE in the VS Wildcard

Hello;

 

i want to use two IRULE in my VS Wilcard.

 

We have two ISP and we want to redirect trafic as bellow:

 

- VPN: to ISP01

 

- SNATting of some internal IPs to go through ISP01.

 

- Load balancing all other trafic between the two ISP (ISP01, ISP02)

 

 

Here is the two IRULE that i want to implement in the VS WildCard Forwarding IP:

 

 

IRULE01

 

-----------------------------------------------------------------

 

when CLIENT_ACCEPTED {

 

if { [IP::protocol] == 50 } {

 

pool POOL_ISP1

 

} elseif { [UDP::local_port] == 500 } {

 

pool POOL_ISP1

 

}

 

}

 

 

IRULE02

 

-----------------------------------------------------------------

 

when LB_SELECTED {

 

if { [IP::addr [IP::client_addr] equals 172.24.95.139 ] } {

 

snat 196.1.1.1

 

pool POOL_ISP1

 

} elseif { [IP::addr [IP::client_addr] equals 172.24.95.133 ] } {

 

snat 196.1.1.2

 

pool POOL_ISP1

 

} elseif { [IP::addr [IP::client_addr] equals 172.24.95.135 ] } {

 

snat 196.1.1.3

 

pool POOL_ISP1

 

} else {

 

snat automap

 

pool POOL_Gateway_ISP01

 

}}

 

-----------------------------------------------------------------

 

 

 

Is it possible to implement these two IRULEs in my VS Wildcard?

 

is the priority importante in my cas, i mean IRULE01 then IRULE02?

 

 

thank you

 

2 Replies

  • Priority is not important in this case as the CLIENT_ACCEPTED event will always fire before the LB_SELECTED event. There is no need to separate these functions into two rules.
  • thanks for your replay;

     

    so if i understand, i wan apply only one IRULE in my VS Wildcard :

     

     

    IRULE01---------------------------------------

     

    when CLIENT_ACCEPTED {

     

    if { [IP::protocol] == 50 } {

     

    pool POOL_ISP1

     

    } elseif { [UDP::local_port] == 500 } {

     

    pool POOL_ISP1

     

    }

     

    }

     

    when LB_SELECTED {

     

    if { [IP::addr [IP::client_addr] equals 172.24.95.139 ] } {

     

    snat 196.1.1.1

     

    pool POOL_ISP1

     

    } elseif { [IP::addr [IP::client_addr] equals 172.24.95.133 ] } {

     

    snat 196.1.1.2

     

    pool POOL_ISP1

     

    } elseif { [IP::addr [IP::client_addr] equals 172.24.95.135 ] } {

     

    snat 196.1.1.3

     

    pool POOL_ISP1

     

    } else {

     

    snat automap

     

    pool POOL_Gateway_ISP01

     

    }}

     

    -----------------------------------------------------------------

     

     

    you think that with this IRULE, the trafic of VPN and SNAT of internal Server pass through ISP01 ?

     

     

    please confirm or if you have another suggetion for my case.

     

    thanks