Networking Forums

Networking Forums > Computer Networking > Linux Networking > Detecting if kernel is ipv6 capable

Reply
Thread Tools Display Modes

Detecting if kernel is ipv6 capable

 
 
robert
Guest
Posts: n/a

 
      05-24-2007, 06:07 PM
Hi all,

I have an embedded system which we want to run some of the installed
application like dhcp and ssh over ipv6. Is there a simple way to
determine if the OS is ipv6 capable? We are tracking down the kernel
sources to do 'make menuconfig' - but thought I'd ask if there is a
way I can know for sure in just the shell.

Robert

 
Reply With Quote
 
 
 
 
Tejas Kokje
Guest
Posts: n/a

 
      05-25-2007, 12:32 AM
On May 24, 11:07 am, robert <robertlazar...@gmail.com> wrote:
> Hi all,
>
> I have an embedded system which we want to run some of the installed
> application like dhcp and ssh over ipv6. Is there a simple way to
> determine if the OS is ipv6 capable? We are tracking down the kernel
> sources to do 'make menuconfig' - but thought I'd ask if there is a
> way I can know for sure in just the shell.
>
> Robert


Check for the /proc/net/if_inet6 file. If it exists, kernel is IPv6
capable. Contents of this file will tell you what layer 3 interfaces
on your system support IPv6. Of course, I am assuming that your
embedded system is running Linux :-).

Thanks

Tejas Kokje

 
Reply With Quote
 
Roy Smith
Guest
Posts: n/a

 
      05-25-2007, 04:07 AM
In article <(E-Mail Removed). com>,
Tejas Kokje <(E-Mail Removed)> wrote:

> On May 24, 11:07 am, robert <robertlazar...@gmail.com> wrote:
> > Hi all,
> >
> > I have an embedded system which we want to run some of the installed
> > application like dhcp and ssh over ipv6. Is there a simple way to
> > determine if the OS is ipv6 capable? We are tracking down the kernel
> > sources to do 'make menuconfig' - but thought I'd ask if there is a
> > way I can know for sure in just the shell.
> >
> > Robert

>
> Check for the /proc/net/if_inet6 file. If it exists, kernel is IPv6
> capable. Contents of this file will tell you what layer 3 interfaces
> on your system support IPv6. Of course, I am assuming that your
> embedded system is running Linux :-).
>
> Thanks
>
> Tejas Kokje


I generally execute (i.e. in a C program).

struct in6_addr buf;
inet_pton(AF_INET6, "::", buf);

if inet_pton() returns 0, you've got an IPv6 capable kernel. If course,
just because your kernel can do IPv6 doesn't always mean the whole box is
set up (i.e. addresses assigned, DNS configured, etc, etc).

But, you asked specifically about things you can do from the shell. In
addition to the above, you might try "ping6 ::1".
 
Reply With Quote
 
Robert Harris
Guest
Posts: n/a

 
      05-25-2007, 07:38 AM
Roy Smith wrote:
> In article <(E-Mail Removed). com>,
> Tejas Kokje <(E-Mail Removed)> wrote:
>
>> On May 24, 11:07 am, robert <robertlazar...@gmail.com> wrote:
>>> Hi all,
>>>
>>> I have an embedded system which we want to run some of the installed
>>> application like dhcp and ssh over ipv6. Is there a simple way to
>>> determine if the OS is ipv6 capable? We are tracking down the kernel
>>> sources to do 'make menuconfig' - but thought I'd ask if there is a
>>> way I can know for sure in just the shell.
>>>
>>> Robert

>> Check for the /proc/net/if_inet6 file. If it exists, kernel is IPv6
>> capable. Contents of this file will tell you what layer 3 interfaces
>> on your system support IPv6. Of course, I am assuming that your
>> embedded system is running Linux :-).
>>
>> Thanks
>>
>> Tejas Kokje

>
> I generally execute (i.e. in a C program).
>
> struct in6_addr buf;
> inet_pton(AF_INET6, "::", buf);


That will tell you if you have an IPv6 capable C library, not an IPv6
capable kernel!

Robert

>
> if inet_pton() returns 0, you've got an IPv6 capable kernel. If course,
> just because your kernel can do IPv6 doesn't always mean the whole box is
> set up (i.e. addresses assigned, DNS configured, etc, etc).
>
> But, you asked specifically about things you can do from the shell. In
> addition to the above, you might try "ping6 ::1".

 
Reply With Quote
 
Tim Southerwood
Guest
Posts: n/a

 
      05-25-2007, 08:45 AM
robert wrote:

> Hi all,
>
> I have an embedded system which we want to run some of the installed
> application like dhcp and ssh over ipv6. Is there a simple way to
> determine if the OS is ipv6 capable? We are tracking down the kernel
> sources to do 'make menuconfig' - but thought I'd ask if there is a
> way I can know for sure in just the shell.
>
> Robert


You could try looking for some "tell-tales" in /proc, eg:

/proc/net/if_inet6

Problem is these are volatile and likely to be renamed whenever the linux
dev guys feel like. That won;t be a problem unless you are writing a script
that needs to run long term through random kernel upgrades. For a spot
check it will tell you though.

Another option is to as "ip", eg:

ip addr ls | grep inet6

Don;t overlook the fact that the kernel may be potentially IPv6 enabled, but
that you might need to load some modules.

HTH

Tim
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel hangs after setting up Ipv6-ipv6 tunnel Kristoff Bonne Linux Networking 0 09-20-2008 08:36 PM
linux from kernel.org and ipv6 Venkat Linux Networking 0 07-23-2008 10:39 PM
detecting tcp/udp socket bind in kernel module hari_kannan@hotmail.com Linux Networking 0 03-21-2007 05:34 PM
strange ipv6 messages after disablling in kernel AA Linux Networking 2 07-20-2005 10:41 PM
Prevent kernel 2.6 ipv6 module from being loaded KhoGuan PhuaN Linux Networking 4 11-25-2003 02:54 PM



1 2 3 4 5 6 7 8 9 10 11