Coder Social home page Coder Social logo

IPv6 seems not to work about captagent HOT 39 CLOSED

sipcapture avatar sipcapture commented on August 21, 2024
IPv6 seems not to work

from captagent.

Comments (39)

adubovikov avatar adubovikov commented on August 21, 2024

to be honest, we didn't check captagent in IPv6, but i don't see any reason, why it should not work:
in the core_hep.c, we do:

if ((s = getaddrinfo(capt_host, capt_port, hints, &ai)) != 0) {
        LERR( "capture: getaddrinfo: %s\n", gai_strerror(s));
        return 2;
}

if((sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) < 0) {
         LERR("Sender socket creation failed: %s\n", strerror(errno));
         return 1;
}

 if (connect(sock, ai->ai_addr, (socklen_t)(ai->ai_addrlen)) == -1) {
     select(sock + 1 , NULL, &myset, NULL, &tv);
     if (errno != EINPROGRESS) {
         LERR("Sender socket creation failed: %s\n", strerror(errno));
         return 1;
      }
}

as you see, getaddrinfo return a struct addressinfo base on the capt_host. So, if your capt_host can be resolved as IPV6 and ai_family set to IPv6 , socket() will open IPv6.

from captagent.

vinzens avatar vinzens commented on August 21, 2024

unfortunately it does not capture anything on an V6 interface.

so far we used "any" as Interface and if no filter set i can see at least the V4 traffic, but if i bind it to the V6 Inteface it just makes nothing.

In Log i can see this during restart the service:

@4000000054c5f0933077a56c The agent has been terminated
@4000000054c5f093307cb264 Loaded core config
@4000000054c5f093307cb264 Loaded core_hep
@4000000054c5f093307cb64c Loaded proto_uni
@4000000054c5f093307cb64c The Captagent is ready
@4000000054c5f093307cba34 expr:portrange 5060-5090 and udp 
@4000000054c5f093307cba34 unloaded module proto_uni
@4000000054c5f093307cba34 unloaded module core_hep
@4000000054c5f093307cbe1c count sends:0
@4000000054c5f093307cbe1c DONE unload

For me "Unload" during stating procedure doesn't look so good. Maybe it should be like this but i'm not sure.
would be great if you can give us a hint what to do.

BR
Jöran Vinzens

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

Are you able to see traffic with tcpdump/ngrep ?

On 2015-01-26 08:49, vinzens wrote:

unfortunately it does not capture anything on an V6 interface.

so far we used "any" as Interface and if no filter set i can see at
least teh V4 traffic, but if i bind it to the V6 Inteface it just
makes nothing.

In Log i can see this during restart the service:

|@4000000054c5f0933077a56c The agent has been terminated
@4000000054c5f093307cb264 Loaded core config
@4000000054c5f093307cb264 Loaded core_hep
@4000000054c5f093307cb64c Loaded proto_uni
@4000000054c5f093307cb64c The Captagent is ready
@4000000054c5f093307cba34 expr:portrange 5060-5090 and udp
@4000000054c5f093307cba34 unloaded module proto_uni
@4000000054c5f093307cba34 unloaded module core_hep
@4000000054c5f093307cbe1c count sends:0
@4000000054c5f093307cbe1c DONE unload
|

For me "Unload" during stating procedure doesn't look so good. Maybe
it should be like this but i'm not sure.
would be great if you can give us a hint what to do.

BR
Jöran Vinzens


Reply to this email directly or view it on GitHub
#6 (comment).

from captagent.

vinzens avatar vinzens commented on August 21, 2024

yes, i am. we started debugging with ngrep since it's our first time to have IPv6 and now we wanted to have the traffic in our Homer. So i'm very certain that there is traffic and we are able to see it by using ngrep.

here a little output from tcpdump
root@server:~# tcpdump host 2001:ab0:1413:affe::aa01 -i any -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 65535 bytes
09:09:12.870847 IP6 2001:ab0:1413:affe::aa01.5060 > 2a01:4f8:211:2203::2.16732: SIP, length: 1436
09:09:12.881478 IP6 2a01:4f8:211:3::2.16732 > 2001:ab0:1413:affe::aa01.5060: SIP, length: 999
09:09:13.432248 IP6 2a01:4f8:211:3::2.16732 > 2001:ab0:1413:affe::aa01.5060: SIP, length: 1015

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

in your config, please comment out port, ip-proto and make a custom filter and activate debug
section: proto_uni.conf

<!--
<param name="ip-proto" value="udp"/>        
<param name="port" value="5060"/>
-->
<param name="filter" value="host  2001:ab0:1413:affe::aa01"/>
<param name="debug" value ="true"/>
<param name="dev"  value="any"/>

and core.conf:

<param name="debug" value="7"/>
<param name="daemon" value="true"/>
<param name="syslog" value="true"/>

after, please check if you will have something in your syslog.
thanks

from captagent.

vinzens avatar vinzens commented on August 21, 2024

No, unfortunately i cannot find anythin new in the log except this:

@4000000054c60bf017ace3e4 Loaded core config
@4000000054c60bf017ace7cc Loaded core_hep
@4000000054c60bf017ace7cc Loaded proto_uni
@4000000054c60bf017acebb4 The Captagent is ready
@4000000054c60bf017acebb4 expr:portrange 5060-5090 and udp and host 2001:ab0:13:affe::aa01
@4000000054c60bf017acef9c unloaded module proto_uni
@4000000054c60bf017acef9c unloaded module core_hep
@4000000054c60bf017acf384 count sends:0
@4000000054c60bf017acf384 DONE unload

But this seems to be quite the same just except the Host Filter

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

you didn't comment out ip-proto and port/portrange.

from captagent.

vinzens avatar vinzens commented on August 21, 2024

yes, sorry.

now i got this:
@4000000054c60fcc1b395e34 Loaded core config
@4000000054c60fcc1b395e34 Loaded core_hep
@4000000054c60fcc1b39621c Loaded proto_uni
@4000000054c60fcc1b39621c The Captagent is ready
@4000000054c60fcc1b396604 expr:port 5060 and host 2001:ab0:13:affe::aa01
@4000000054c60fcc1b396604 unloaded module proto_uni
@4000000054c60fcc1b3969ec unloaded module core_hep
@4000000054c60fcc1b3969ec count sends:0
@4000000054c60fcc1b3969ec DONE unload

if i uncomment Port or Portrange it takes by default port 5060 so my filter must look like "and host ..." else i get an error for the filter syntax.

Bit in my case SIP is on Port 5060 so it should not permit the data.

Still it's not working

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

i have added more debug, can you please pull the last git and start again ? Please be sure that you have activated debug in the proto_uni section.

thanks.

from captagent.

vinzens avatar vinzens commented on August 21, 2024

this doesn't look any better.
I cloned the git and made installation according your README.

started the captagent with
captagent -f /usr/local/etc/captagent/captagent.xml

in syslog all i can find is:
Jan 26 12:03:32 kammel captagent[14675]: [NOTICE] DONE unload
Jan 26 12:04:24 kammel captagent[14683]: [NOTICE] The Captagent is ready

if i do not daemonize the captagent i can see this in console:
Loaded core_hep
Loaded proto_uni
expr:port 5060 and host 2001:ab0:13:affe::aa01

unfortunately nothing else

please find below the config file (maybe there is something wrong in it):

    <configuration name="core.conf" description="CORE Settings">
            <settings>
                    <param name="debug" value="7"/>
                    <param name="daemon" value="false"/>
                    <param name="syslog" value="true"/>
                    <param name="path" value="/usr/lib/captagent/modules"/>
            </settings>
    </configuration>

    <configuration name="modules.conf" description="Modules">
            <modules>
                    <load module="core_hep"/>
                    <load module="proto_uni"/>
            </modules>
    </configuration>

    <!-- CORE MODULES -->

    <configuration name="core_hep.conf" description="HEP Socket">
            <settings>
                    <param name="version" value="3"/>
                    <param name="capture-host" value="homer02.sipgate.net"/>
                    <param name="capture-port" value="9060"/>
                    <param name="capture-proto" value="udp"/>
                    <param name="payload-compression" value="false" />
                    <param name="capture-id" value="kammel"/>
                    <param name="capture-password" value="kammelMyHep2001"/>
            </settings>
    </configuration>

    <!-- PROTOCOLS -->

    <configuration name="proto_uni.conf" description="UNI Proto Basic capture">
            <settings>
                    <!-- <param name="port" value="5060"/> -->
                    <!-- <param name="portrange" value="5060-5090"/> -->
                    <param name="debug"  value="true"/>
                    <param name="dev"  value="any"/>
                    <param name="promisc" value="true"/>
                    <!-- <param name="ip-proto" value="udp"/> -->
                    <param name="proto-type"  value="sip"/>
                    <param name="sip_method" value="!OPTIONS"/>
                    <!-- <param name="sip_subscribe_method" value="!SUBSCRIBE"/> -->
                    <param name="filter" value="and host 2001:ab0:13:affe::aa01"/>
            </settings>
    </configuration>

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

can u please download https://github.com/sipcapture/sipgrep and run the same filter ?
it looks very weird for me, because there is no packets at all...

from captagent.

vinzens avatar vinzens commented on August 21, 2024

sipgrep does not show the packets, too.

I now made trace on tcpdump and sipgrep at the same time on that mashin, zo ensure the SIP V6 Traffic is passing this system as expected.

made sure the IP is correct:
sudo ifconfig|grep "2001:ab0:13:affe::aa01"
inet6 addr: 2001:ab0:13:affe::aa01/64 Scope:Global

enabled sipgrep like
sudo sipgrep -d any host 2001:ab0:13:affe::aa01
interface: any
filter: (ip) and ( host 2001:ab0:13:affe::aa01 )

nothing....

where tcpdump gave output
tcpdump -i any host 2001:ab0:13:affe::aa01
13:04:42.263148 IP6 2001:ab0:13:affe::aa01.5060 > 2a01:4f8:211:2203::2.16732: SIP, length: 1419
13:04:42.273637 IP6 2a01:4f8:211:2203::2.16732 > 2001:ab0:13:affe::aa01.5060: SIP, length: 999
...
...

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

unfortunatley you didn't define --enable-ipv6 for sipgrep.

from captagent.

vinzens avatar vinzens commented on August 21, 2024

ok, i made it again:

  1. make clean
  2. ./configure --enable-ipv6
  3. make && sudo make install
  4. sudo sipgrep -d any host 2001:ab0:13:affe::aa01

same result

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

please show me the output of sudo sipgrep -d any host 2001:ab0:13:affe::aa01

from captagent.

vinzens avatar vinzens commented on August 21, 2024

it looks like:

vinzens@server:/sipgrep$ sudo sipgrep -d any host 2001:ab0:13:affe::aa01
interface: any
filter: (ip or ip6) and ( host 2001:ab0:13:affe::aa01 )
^Cvinzens@server:
/sipgrep$

i placed a call between starting and stoppung the trace. tcpdump again showed packets.

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

ok, I have to setup IPv6 and check it by self.This can take a while.

from captagent.

vinzens avatar vinzens commented on August 21, 2024

OK, many thanks for your help! We'll wait for your feedback.

from captagent.

vinzens avatar vinzens commented on August 21, 2024

Hi, have you made any progress in this issue? If you need someone to test something, please let us know.

Best regards

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

not yet. but if you can provide an ssh w/root credentials, we can speed up it

from captagent.

vinzens avatar vinzens commented on August 21, 2024

Unfortunately this is not possible since our security policy does not allow this on Live systems. So far we do not have a DEV setup.

Sorry

So we will wait.

from captagent.

vinzens avatar vinzens commented on August 21, 2024

Hi again,

finally we have installed captagent V6. Since i cannot find any docu about IPv6 config here the question:

How do i configure the socket_pcap in order to get IPv6 Packets? At the moment it looks pritty much like your sample, but im not able to get IPv6 sniffed.

filter in socket_pcap looks like:

    <param name="filter">
    <value>ip6</value>
    </param>

do you have any hints?

from captagent.

SipSeb avatar SipSeb commented on August 21, 2024

When looking into this, I saw there were some lines in the code, which were only compiled if a precompiler variable USE_IPv6 is set. But this variable was never set.
I tried adding an option to configure, you can now call it with --enable-ipv6, then the following line is written:
src/config.h:#define USE_IPv6 1

Then I replaced all the #if USE_IPv6 lines with #ifdef USE_IPv6. Maybe this wasn't necessary but it doesn't hurt.

After building the debian package and installing, I still only get IPv4 output. I'm out of ideas, what is needed to get IPv6 support up and running.

You can find my work here:
https://github.com/SipSeb/captagent/tree/ipv6
Since it isn't working, I haven't sent a pull request.

Do you have any more hints what is missing?

from captagent.

SipSeb avatar SipSeb commented on August 21, 2024

I talked about this issue at KamailioWorld with @lmangani, and he told me that he knows what the problem is and how it can be fixed. Are there any plans to make IPv6 in captagent work?

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

Hi Sebastian,

can you provide ssh to any Ipv6 box with sip traffic and we can check it together ?
you can ping me also in gtalk.

from captagent.

SipSeb avatar SipSeb commented on August 21, 2024

Actually, that's a bit difficult. But @lmangani said, he knows what to do and he has an IPv6 setup.

Otherwise, you could come visit us for a day, then we could look at it together.

from captagent.

lmangani avatar lmangani commented on August 21, 2024

@SipSeb that's indeed correct - testing resumed ;)

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

@SipSeb can you try the last git ? Should works now

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

please don't forget to enable ipv6
./configure --enable-ipv6

from captagent.

SipSeb avatar SipSeb commented on August 21, 2024

Sorry for the late reply, but the sipcapture job on our build system is currently broken. I'm gonna try as soon as I get to it.

from captagent.

SipSeb avatar SipSeb commented on August 21, 2024

Wow, that libuv dependency makes it hard to test right now. Need to upgrade the IPv6 system from wheezy to jessie first. ;)

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

Why ?

https://github.com/sipcapture/captagent/tree/master/dependency/debian/wheezy

from captagent.

SipSeb avatar SipSeb commented on August 21, 2024

Yes, I've seen that. But for wheezy the libuv-dev package is missing which is probably needed for building captagent, and the other reason is that our build system expects those build dependencies in some repository. It's not that easy unfortunately.

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

this is custom package and it already includes dev as well...

On 01.07.2016 15:26, Sebastian Damm wrote:

Yes, I've seen that. But for wheezy the libuv-dev package is missing
which is probably needed for building captagent, and the other reason
is that our build system expects those build dependencies in some
repository. It's not that easy unfortunately.


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#6 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AETdJeLfCMDc5Of6vkN5lCkP9dXiDMxAks5qRRV7gaJpZM4DWYuK.

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

any progress ?

from captagent.

SipSeb avatar SipSeb commented on August 21, 2024

Yes. I managed to backport the libuv package from jessie-backports and put it in our repository. So now I have a running captagent on Wheezy.

The good thing: It now captures IPv6 packets. 👍
The bad thing: New bug, I can't use hostnames in my transport_hep.xml anymore. In our previous version built in January (and before with the old captagent) we could use hostnames in there. Now if we leave the configuration unchanged, captagent sends all packets to 127.0.0.1. Should I open a new bug for this issue?

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

yes please ;-)

i know, the function of libuv doesn't accept hostname as param. Please open
as a CR not as a bug ;-)

Wbr,
Alexandr

On 13 July 2016 at 09:35, Sebastian Damm [email protected] wrote:

Yes. I managed to backport the libuv package from jessie-backports and put
it in our repository. So now I have a running captagent on Wheezy.

The good thing: It now captures IPv6 packets. 👍
The bad thing: New bug, I can't use hostnames in my transport_hep.xml
anymore. In our previous version built in January (and before with the old
captagent) we could use hostnames in there. Now if we leave the
configuration unchanged, captagent sends all packets to 127.0.0.1. Should I
open a new bug for this issue?


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#6 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AETdJZI7WuW3TP1oD_LfsneCVBQyYP2zks5qVJU9gaJpZM4DWYuK
.

from captagent.

SipSeb avatar SipSeb commented on August 21, 2024

Isn't CR vs. bug only a thing of labels attached to the issus? Or did you mean something else? Anyway, I've opened an issue. If this was wrong, just let me know.

I'm going to close this bug (if I'm allowed to).

from captagent.

adubovikov avatar adubovikov commented on August 21, 2024

so, looks like the ticket can be closed. Please reopen if anything.

from captagent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.