<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>I haven't worked with vrf here, so no first hand experience ...</p>
    <p>What happens if you try with next option?</p>
    <p>listen=vrf-green:5060 advertise 2.2.2.2:5060<br>
    </p>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 25.09.17 19:10, George
      Diamantopoulos wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAPcKEYMoseDPC=nzemxPMHT8TRfuyYsRXcw-XMP_txMfTFm3qQ@mail.gmail.com">
      <div dir="ltr">Sorry to bump this, but it would be very useful if
        I knew whether there's any point in pursuing this or not. Any
        hints?<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 21 September 2017 at 14:06, George
          Diamantopoulos <span dir="ltr"><<a
              href="mailto:georgediam@gmail.com" target="_blank"
              moz-do-not-send="true">georgediam@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>
                            <div>
                              <div>
                                <div>
                                  <div><span
                                      style="font-family:monospace,monospace">Hello,<br>
                                      <br>
                                    </span></div>
                                  <span
                                    style="font-family:monospace,monospace">I
                                    have a use case where I need to have
                                    kamailio bind to a VRF device. The
                                    configuration in question is similar
                                    to the example below, where eth1 is
                                    a slave to the VRF-lite device:<br>
                                    <br>
                                     +----------+     
                                    +-------------------+<br>
                                     |   eth0   |      |   
                                    vrf-green      |<br>
                                     | 1.1.1.1  |      |   
                                    127.0.0.1      |<br>
                                     +----------+     
                                    +-------------------+<br>
                                                               
                                    |           <br>
                                                         
                                    +----------+      <br>
                                                          |   eth1  
                                    |    <br>
                                                          | 2.2.2.2  |  
                                    <br>
                                                          +----------+<br>
                                    <br>
                                  </span></div>
                                <span
                                  style="font-family:monospace,monospace">Both
                                  the main routing table and "vrf-green"
                                  routing table have a default route.<br>
                                  <br>
                                  What I need to be able to do is have
                                  kamailio bind to both interfaces:<br>
                                  <br>
                                </span></div>
                              <div style="margin-left:40px"><span
                                  style="font-family:monospace,monospace">listen=eth0:5060</span><br>
                                <span
                                  style="font-family:monospace,monospace"></span><span
style="font-family:monospace,monospace"><span
                                    style="font-family:monospace,monospace">listen=vrf-green:5060</span></span><br>
                              </div>
                              <div style="margin-left:40px"><span
                                  style="font-family:monospace,monospace"><span
style="font-family:monospace,monospace"></span></span></div>
                              <span
                                style="font-family:monospace,monospace"><span
style="font-family:monospace,monospace"><br>
                                </span></span></div>
                            <span
                              style="font-family:monospace,monospace"><span
                                style="font-family:monospace,monospace">And
                                additionally be able to use
                                force_send_socket to select an
                                interface, for example:<br>
                                <br>
                              </span></span>
                            <div style="margin-left:40px"><span
                                style="font-family:monospace,monospace"><span
style="font-family:monospace,monospace">force_send_socket(udp:<a
                                    href="http://2.2.2.2:5060"
                                    target="_blank"
                                    moz-do-not-send="true">2.2.2.2:<wbr>5060</a>);</span></span><br>
                            </div>
                            <div style="margin-left:40px"><span
                                style="font-family:monospace,monospace"><span
style="font-family:monospace,monospace"></span></span></div>
                            <span
                              style="font-family:monospace,monospace"><span
                                style="font-family:monospace,monospace"><br>
                              </span></span></div>
                          <span style="font-family:monospace,monospace"><span
                              style="font-family:monospace,monospace">However,
                              I can't get this to work. The above
                              configuration fails because there is no
                              listen directive for 2.2.2.2. Also,
                              kamailio doesn't process packets received
                              on the VRF with the above listen
                              directives, it behaves as if it doesn't
                              listen on 2.2.2.2 indeed.<br>
                              <br>
                            </span></span></div>
                        <span style="font-family:monospace,monospace"><span
                            style="font-family:monospace,monospace">In
                            addition using either of the below:<br>
                          </span></span></div>
                      <span style="font-family:monospace,monospace"><span
                          style="font-family:monospace,monospace"><br>
                        </span></span></div>
                    <div style="margin-left:40px"><span
                        style="font-family:monospace,monospace"><span
                          style="font-family:monospace,monospace">listen=udp:<a
                            href="http://2.2.2.2:5060" target="_blank"
                            moz-do-not-send="true">2.2.2.2:5060</a></span></span></div>
                    <div style="margin-left:40px"><span
                        style="font-family:monospace,monospace"><span
                          style="font-family:monospace,monospace">or</span></span><br>
                      <span style="font-family:monospace,monospace"><span
                          style="font-family:monospace,monospace"></span></span><span
                        style="font-family:monospace,monospace"><span
                          style="font-family:monospace,monospace">listen=eth1:5060</span></span><br>
                    </div>
                    <div style="margin-left:40px"><span
                        style="font-family:monospace,monospace"><span
                          style="font-family:monospace,monospace"></span></span></div>
                  </div>
                  <span style="font-family:monospace,monospace"><span
                      style="font-family:monospace,monospace"><br>
                    </span></span></div>
                <span style="font-family:monospace,monospace"><span
                    style="font-family:monospace,monospace">fails with
                    an error upon starting kamailio.<br>
                    <br>
                  </span></span></div>
              <span style="font-family:monospace,monospace"><span
                  style="font-family:monospace,monospace">According to
                  the kernel documentation:<br>
                </span></span>
              <pre style="margin-left:40px">Applications that are to work within a VRF need to bind their socket to the
VRF device:

    setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1);

or to specify the output device using cmsg and IP_PKTINFO.
</pre>
              <pre>The question is, is VRF useable with kamailio right now? Or is development needed? Thanks!

</pre>
              <pre>BR,
</pre>
              <pre>George
</pre>
              <span style="font-family:monospace,monospace"><span
                  style="font-family:monospace,monospace"></span></span><span
                style="font-family:monospace,monospace"><span
                  style="font-family:monospace,monospace"></span></span></div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>