LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-02-2010, 08:09 AM   #1
zgh
LQ Newbie
 
Registered: Nov 2010
Posts: 1

Rep: Reputation: 0
how to get port information from xfrm?


Hello,

I have the following question:

How can I get the port information about the "session" that triggered a xfrm acquire, without using ports in policies?

An example:
I'm using the Host Identity Protocol for signaling and securing communication between two hosts. What it does is set up a policy for the HIP Address Prefix (2001:10::/28). ip xfrm monitor:

Code:
src 2001:10::/28 dst 2001:10::/28 
        dir in priority 0 
        tmpl src :: dst ::
                proto 0 reqid 0 mode transport

src 2001:10::/28 dst 2001:10::/28 
        dir out priority 0 
        tmpl src :: dst ::
                proto 0 reqid 0 mode transport
Now, when I trigger a new connection between the two hosts the acquire message looks like this (I'm using ssh for this example, therefore destination port 22). ip xfrm monitor dumps:

Code:
acquire proto 0 
  sel src 2001:16:2895:e713:474d:2e1c:42e3:81b1/128 dst 2001:11:eb2c:9bcf:7908:b80a:c16c:dfa/128 proto tcp sport 0 dport 22 
  policy src 2001:10::/28 dst 2001:10::/28 
        dir out priority 0 
        tmpl src :: dst ::
                proto 0 reqid 0 mode transport
What I'm interested in are the source and destination ports. As you can see, the destination port is set correctly, yet the source port is not? Why is that? Is there any way to get the source port, too?

Any suggestions?
Thanks!
 
Old 11-16-2010, 11:28 AM   #2
mdlinuxwolf
Member
 
Registered: Dec 2006
Distribution: Mepis and Fedora, also Mandrake and SuSE PC-BSD Mint Solaris 11 express
Posts: 385

Rep: Reputation: 42
Cool Try Wireshark !!

Quote:
Originally Posted by zgh View Post
Hello,

I have the following question:

How can I get the port information about the "session" that triggered a xfrm acquire, without using ports in policies?

An example:
I'm using the Host Identity Protocol for signaling and securing communication between two hosts. What it does is set up a policy for the HIP Address Prefix (2001:10::/28). ip xfrm monitor:

Code:
src 2001:10::/28 dst 2001:10::/28 
        dir in priority 0 
        tmpl src :: dst ::
                proto 0 reqid 0 mode transport

src 2001:10::/28 dst 2001:10::/28 
        dir out priority 0 
        tmpl src :: dst ::
                proto 0 reqid 0 mode transport
Now, when I trigger a new connection between the two hosts the acquire message looks like this (I'm using ssh for this example, therefore destination port 22). ip xfrm monitor dumps:

Code:
acquire proto 0 
  sel src 2001:16:2895:e713:474d:2e1c:42e3:81b1/128 dst 2001:11:eb2c:9bcf:7908:b80a:c16c:dfa/128 proto tcp sport 0 dport 22 
  policy src 2001:10::/28 dst 2001:10::/28 
        dir out priority 0 
        tmpl src :: dst ::
                proto 0 reqid 0 mode transport
What I'm interested in are the source and destination ports. As you can see, the destination port is set correctly, yet the source port is not? Why is that? Is there any way to get the source port, too?

Any suggestions?
Thanks!
This suggestion might be a little "off the beaten path" but I would suggest using an application called Wireshark instead of what you are using now. Wireshark will tell you more then you wanted to ever know about your network, & then even more then that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Port information. ex-para Linux - Newbie 16 03-16-2010 01:56 PM
Which is the difference between Netfilter and XFRM framework? chiodo Programming 0 06-08-2009 11:29 AM
XFRM structure LegolasV Linux - Kernel 0 06-20-2006 08:55 PM
xfrm in ipsec atul_mehrotra Linux - Security 1 05-28-2005 06:28 AM
port information tarak4u Linux - Networking 2 05-30-2002 11:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration