netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to identify 6to4 and 6in4 tunnels
@ 2014-01-27 10:39 zhuyj
  2014-01-27 12:59 ` Nicolas Dichtel
  0 siblings, 1 reply; 6+ messages in thread
From: zhuyj @ 2014-01-27 10:39 UTC (permalink / raw)
  To: David S. Miller, netdev, kuznet, jmorris, yoshfuji, kaber,
	linux-kernel, zhuyj

Hi, Maintainers

In our scene, we will create the 6in4/6to4 tunnel firstly and need to 
check the tunnel type, secondly, we will configure the ip address on it. 
So, Could we have any way to get the actual tunnel for 6in4 and 6to4 
from current linux version?

Both 6in4 and 6to4 have the same protocol “IPPROTO_IPV6” in Linux 
kernel. The only difference is the ip address on the tunnel. Can we 
distinguish them in Linux kernel?

Best Regards

Zhu Yanjun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to identify 6to4 and 6in4 tunnels
  2014-01-27 10:39 How to identify 6to4 and 6in4 tunnels zhuyj
@ 2014-01-27 12:59 ` Nicolas Dichtel
  2014-01-28  7:32   ` zhuyj
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Dichtel @ 2014-01-27 12:59 UTC (permalink / raw)
  To: zhuyj, David S. Miller, netdev, kuznet, jmorris, yoshfuji, kaber,
	linux-kernel

Le 27/01/2014 11:39, zhuyj a écrit :
> Hi, Maintainers
>
> In our scene, we will create the 6in4/6to4 tunnel firstly and need to check the
> tunnel type, secondly, we will configure the ip address on it. So, Could we have
> any way to get the actual tunnel for 6in4 and 6to4 from current linux version?
>
> Both 6in4 and 6to4 have the same protocol “IPPROTO_IPV6” in Linux kernel. The
> only difference is the ip address on the tunnel. Can we distinguish them in
> Linux kernel?
Just check the prefix, like it is done in check_6rd().


Regards,
Nicolas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to identify 6to4 and 6in4 tunnels
  2014-01-27 12:59 ` Nicolas Dichtel
@ 2014-01-28  7:32   ` zhuyj
  2014-01-28  7:39     ` zhuyj
  0 siblings, 1 reply; 6+ messages in thread
From: zhuyj @ 2014-01-28  7:32 UTC (permalink / raw)
  To: nicolas.dichtel, David S. Miller, netdev, kuznet, jmorris,
	yoshfuji, kaber, linux-kernel

On 01/27/2014 08:59 PM, Nicolas Dichtel wrote:
> Le 27/01/2014 11:39, zhuyj a écrit :
>> Hi, Maintainers
>>
>> In our scene, we will create the 6in4/6to4 tunnel firstly and need to 
>> check the
>> tunnel type, secondly, we will configure the ip address on it. So, 
>> Could we have
>> any way to get the actual tunnel for 6in4 and 6to4 from current linux 
>> version?
>>
>> Both 6in4 and 6to4 have the same protocol “IPPROTO_IPV6” in Linux 
>> kernel. The
>> only difference is the ip address on the tunnel. Can we distinguish 
>> them in
>> Linux kernel?
> Just check the prefix, like it is done in check_6rd().
>
>
> Regards,
> Nicolas
>
Hi, Nicolas

Thanks for your reply. Maybe I can configure 6to4 tunnel by the 
following commands:

  ip tunnel add tun6to4 mode sit remote any local 1.202.252.122 ttl 64
  ip link set dev tun6to4 up
  ip -6 addr add 2002:01ca:fc7a::0012:0225:2122/128 dev tun6to4
  ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1

But the kernel can not identify the tunnel is 6to4 tunnel or 6in4 tunnel 
immediately. After the packets travel through this tunnel, the kernel 
can identify the type of the tunnel by check_6rd.

Is it right?

Best Regards!
Zhu Yanjun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to identify 6to4 and 6in4 tunnels
  2014-01-28  7:32   ` zhuyj
@ 2014-01-28  7:39     ` zhuyj
  2014-01-28 10:18       ` zhuyj
  2014-01-28 15:20       ` Nicolas Dichtel
  0 siblings, 2 replies; 6+ messages in thread
From: zhuyj @ 2014-01-28  7:39 UTC (permalink / raw)
  To: nicolas.dichtel, David S. Miller, netdev, kuznet, jmorris,
	yoshfuji, kaber, linux-kernel, zhuyj

On 01/28/2014 03:32 PM, zhuyj wrote:
> On 01/27/2014 08:59 PM, Nicolas Dichtel wrote:
>> Le 27/01/2014 11:39, zhuyj a écrit :
>>> Hi, Maintainers
>>>
>>> In our scene, we will create the 6in4/6to4 tunnel firstly and need 
>>> to check the
>>> tunnel type, secondly, we will configure the ip address on it. So, 
>>> Could we have
>>> any way to get the actual tunnel for 6in4 and 6to4 from current 
>>> linux version?
>>>
>>> Both 6in4 and 6to4 have the same protocol “IPPROTO_IPV6” in Linux 
>>> kernel. The
>>> only difference is the ip address on the tunnel. Can we distinguish 
>>> them in
>>> Linux kernel?
>> Just check the prefix, like it is done in check_6rd().
>>
>>
>> Regards,
>> Nicolas
Hi, Nicolas
Thanks for your reply. Maybe I can configure 6to4 tunnel by the 
following commands:

  ip tunnel add tun6to4 mode sit remote any local 1.202.252.122 ttl 64
  ip link set dev tun6to4 up
  ip -6 addr add 2002:01ca:fc7a::0012:0225:2122/128 dev tun6to4
  ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1

But the kernel can not identify the tunnel is 6to4 tunnel or 6in4 tunnel 
immediately. After the packets travel through this tunnel, the kernel 
can identify the type of the tunnel by check_6rd.

Is it right?

Best Regards!
Zhu Yanjun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to identify 6to4 and 6in4 tunnels
  2014-01-28  7:39     ` zhuyj
@ 2014-01-28 10:18       ` zhuyj
  2014-01-28 15:20       ` Nicolas Dichtel
  1 sibling, 0 replies; 6+ messages in thread
From: zhuyj @ 2014-01-28 10:18 UTC (permalink / raw)
  To: nicolas.dichtel, David S. Miller, netdev, kuznet, jmorris,
	yoshfuji, kaber, linux-kernel, zhuyj

On 01/28/2014 03:39 PM, zhuyj wrote:
> On 01/28/2014 03:32 PM, zhuyj wrote:
>> On 01/27/2014 08:59 PM, Nicolas Dichtel wrote:
>>> Le 27/01/2014 11:39, zhuyj a écrit :
>>>> Hi, Maintainers
>>>>
>>>> In our scene, we will create the 6in4/6to4 tunnel firstly and need 
>>>> to check the
>>>> tunnel type, secondly, we will configure the ip address on it. So, 
>>>> Could we have
>>>> any way to get the actual tunnel for 6in4 and 6to4 from current 
>>>> linux version?
>>>>
>>>> Both 6in4 and 6to4 have the same protocol “IPPROTO_IPV6” in Linux 
>>>> kernel. The
>>>> only difference is the ip address on the tunnel. Can we distinguish 
>>>> them in
>>>> Linux kernel?
>>> Just check the prefix, like it is done in check_6rd().
>>>
>>>
>>> Regards,
>>> Nicolas
> Hi, Nicolas
> Thanks for your reply. Maybe I can configure 6to4 tunnel by the 
> following commands:
>
>  ip tunnel add tun6to4 mode sit remote any local 1.202.252.122 ttl 64
>  ip link set dev tun6to4 up
>  ip -6 addr add 2002:01ca:fc7a::0012:0225:2122/128 dev tun6to4
>  ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1
>
> But the kernel can not identify the tunnel is 6to4 tunnel or 6in4 
> tunnel immediately. After the packets travel through this tunnel, the 
> kernel can identify the type of the tunnel by check_6rd.
>
> Is it right?
>
> Best Regards!
> Zhu Yanjun
>
>
Hi, David

I want to identify sit interface 6to4 or 6in4 with the following parameters.

include/uapi/linux/if_tunnel.h
...
struct ip_tunnel_parm {
         char                    name[IFNAMSIZ];
         int                     link;
         __be16                  i_flags;             <---------I want 
to use this variable to identify the type of sit interface. Can I?
         __be16                  o_flags;
         __be32                  i_key;
         __be32                  o_key;
         struct iphdr            iph;
};
...

Please comment on this ? Thanks a lot.

Best Regards!
Zhu Yanjun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to identify 6to4 and 6in4 tunnels
  2014-01-28  7:39     ` zhuyj
  2014-01-28 10:18       ` zhuyj
@ 2014-01-28 15:20       ` Nicolas Dichtel
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Dichtel @ 2014-01-28 15:20 UTC (permalink / raw)
  To: zhuyj, David S. Miller, netdev, kuznet, jmorris, yoshfuji, kaber,
	linux-kernel

Le 28/01/2014 08:39, zhuyj a écrit :
> On 01/28/2014 03:32 PM, zhuyj wrote:
>> On 01/27/2014 08:59 PM, Nicolas Dichtel wrote:
>>> Le 27/01/2014 11:39, zhuyj a écrit :
>>>> Hi, Maintainers
>>>>
>>>> In our scene, we will create the 6in4/6to4 tunnel firstly and need to check the
>>>> tunnel type, secondly, we will configure the ip address on it. So, Could we
>>>> have
>>>> any way to get the actual tunnel for 6in4 and 6to4 from current linux version?
>>>>
>>>> Both 6in4 and 6to4 have the same protocol “IPPROTO_IPV6” in Linux kernel. The
>>>> only difference is the ip address on the tunnel. Can we distinguish them in
>>>> Linux kernel?
>>> Just check the prefix, like it is done in check_6rd().
>>>
>>>
>>> Regards,
>>> Nicolas
> Hi, Nicolas
> Thanks for your reply. Maybe I can configure 6to4 tunnel by the following commands:
>
>   ip tunnel add tun6to4 mode sit remote any local 1.202.252.122 ttl 64
>   ip link set dev tun6to4 up
>   ip -6 addr add 2002:01ca:fc7a::0012:0225:2122/128 dev tun6to4
>   ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1
>
> But the kernel can not identify the tunnel is 6to4 tunnel or 6in4 tunnel
> immediately. After the packets travel through this tunnel, the kernel can
> identify the type of the tunnel by check_6rd.
>
> Is it right?
As soon as you have added the ipv6 addresses, you know that this tunnel is a
6to4 tunnel.
But what problem are you trying to solve?


Regards,
Nicolas

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-28 15:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-27 10:39 How to identify 6to4 and 6in4 tunnels zhuyj
2014-01-27 12:59 ` Nicolas Dichtel
2014-01-28  7:32   ` zhuyj
2014-01-28  7:39     ` zhuyj
2014-01-28 10:18       ` zhuyj
2014-01-28 15:20       ` Nicolas Dichtel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).