"Using vrf routes and tables affect selected tx_fib_index but address
allocation for snat(nat_ed_alloc_addr_and_port function) is based on
rx_fib_index."
 - Pretty sure that's not true at all I would know as a maintainer of nat
:). If tx_fib_index is supplied then resolution of the pool address is
changed.

static int
nat_ed_alloc_addr_and_port (snat_main_t *sm, u32 rx_fib_index,
                            u32 tx_sw_if_index, u32 nat_proto,
                            u32 thread_index, ip4_address_t s_addr,
                            ip4_address_t d_addr, u32 snat_thread_index,
                            snat_session_t *s, ip4_address_t *outside_addr,
                            u16 *outside_port)
{
  if (vec_len (sm->addresses) > 0)
    {
      u32 s_addr_offset = s_addr.as_u32 % vec_len (sm->addresses);
      snat_address_t *a, *ja = 0, *ra = 0, *ba = 0;
      int i;

      // output feature
      if (tx_sw_if_index != ~0)

 - here we go if tx_sw_if_index is supplied then resolution changes.
 - for both output & not output feature next line of code is used to grab
the tx_fib_index:

tx_fib_index = get_tx_fib_index (rx_fib_index, r_addr);

So I suggest playing around with the configuration. The hints I gave you
should direct you to correct configuration.

Best regards,
Filip Varga


so 24. 9. 2022 o 13:26 Amir Hossein <1377amirhossein1...@gmail.com>
napĂ­sal(a):

> thanks for your detail answer.
> but again my goal is to have separate nat ip pool per output interface.
> in my case i have one in interface and two out if, i want out if1 uses nat
> ip address A  and out if2 uses nat ip address B.
> using vrf routes and tables affect selected tx_fib_index but address
> allocation for snat(nat_ed_alloc_addr_and_port function) is based on
> rx_fib_index.
> 
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#21919): https://lists.fd.io/g/vpp-dev/message/21919
Mute This Topic: https://lists.fd.io/mt/93820447/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to