Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 seems not to work #6

Closed
vinzens opened this issue Jan 23, 2015 · 39 comments
Closed

IPv6 seems not to work #6

vinzens opened this issue Jan 23, 2015 · 39 comments
Assignees

Comments

@vinzens
Copy link

vinzens commented Jan 23, 2015

Hi all,

is there any support for IPv6 networks? So far we are running capagent on V4 only but we will expand our network to V6. Unfortunately captagent does not send HEP to kamailio from V6 interfaces.

Also i couldn't find any config to enable V6.

Does anyone have an idea how to enable?

thanks in adavnce

@adubovikov
Copy link
Member

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.

@vinzens
Copy link
Author

vinzens commented Jan 26, 2015

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

@adubovikov
Copy link
Member

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).

@vinzens
Copy link
Author

vinzens commented Jan 26, 2015

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

@adubovikov
Copy link
Member

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

@vinzens
Copy link
Author

vinzens commented Jan 26, 2015

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

@adubovikov
Copy link
Member

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

@vinzens
Copy link
Author

vinzens commented Jan 26, 2015

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

@adubovikov
Copy link
Member

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.

@vinzens
Copy link
Author

vinzens commented Jan 26, 2015

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>

@adubovikov
Copy link
Member

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...

@vinzens
Copy link
Author

vinzens commented Jan 26, 2015

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
...
...

@adubovikov
Copy link
Member

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

@vinzens
Copy link
Author

vinzens commented Jan 26, 2015

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

@adubovikov
Copy link
Member

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

@vinzens
Copy link
Author

vinzens commented Jan 26, 2015

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.

@adubovikov
Copy link
Member

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

@adubovikov adubovikov added bug and removed question labels Jan 26, 2015
@vinzens
Copy link
Author

vinzens commented Jan 26, 2015

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

@vinzens
Copy link
Author

vinzens commented Feb 23, 2015

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

Best regards

@adubovikov
Copy link
Member

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

@vinzens
Copy link
Author

vinzens commented Feb 23, 2015

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.

@vinzens
Copy link
Author

vinzens commented Jan 21, 2016

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?

@SipSeb
Copy link
Contributor

SipSeb commented Feb 8, 2016

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?

@SipSeb
Copy link
Contributor

SipSeb commented Jun 20, 2016

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?

@adubovikov
Copy link
Member

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.

@SipSeb
Copy link
Contributor

SipSeb commented Jun 21, 2016

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.

@lmangani
Copy link
Member

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

@adubovikov
Copy link
Member

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

@adubovikov
Copy link
Member

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

@SipSeb
Copy link
Contributor

SipSeb commented Jun 29, 2016

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.

@SipSeb
Copy link
Contributor

SipSeb commented Jul 1, 2016

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

@adubovikov
Copy link
Member

@SipSeb
Copy link
Contributor

SipSeb commented Jul 1, 2016

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.

@adubovikov
Copy link
Member

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.

@adubovikov
Copy link
Member

any progress ?

@SipSeb
Copy link
Contributor

SipSeb commented Jul 13, 2016

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?

@adubovikov
Copy link
Member

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 notifications@github.com 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
.

@SipSeb
Copy link
Contributor

SipSeb commented Jul 13, 2016

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).

@adubovikov
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants