Forum Discussion

Luke_W_168008's avatar
Luke_W_168008
Icon for Nimbostratus rankNimbostratus
Nov 27, 2018

IP::remote_addr is adding %1 at the end

I have an iRule that I'm trying to save the remote/client IP address to a variable then compare it to specific IP addresses. The variable is ending in %1 how do I remove the %1?

    when CLIENT_ACCEPTED {
set ipadd [IP::remote_addr]

log local0. "IP addr is $ipadd"

if { $ipadd equals"192.168.1.21" } 
    {
        pool smtp03
    }
elseif
    { $ipadd equals "192.168.3.99" }
    {
         pool smtp02
    }
else
    {
       pool smtp01
    }
}

The log entry look is showing: Rule /common/SMTP_Routing : IP addr is 192.168.3.99%1

1 Reply

  • This is because of route domains...

    Replace

    [IP:remote_addr]
    with
    [getfield [IP:remote_addr] % 1]
    to split the address with % as separator.