Networking Forums

Networking Forums > Computer Networking > Linux Networking > Stop ifconfig from adding an ipv6 address?

Reply
Thread Tools Display Modes

Stop ifconfig from adding an ipv6 address?

 
 
Brad
Guest
Posts: n/a

 
      02-28-2008, 02:18 AM
Hi. I'm running Linux 2.6.23.14 with Slackware 12.0 and have had
my first exposure to ipv6. It seems that ifconfig (from net-tools
1.60) will automatically assign an ipv6 address to my ethernet
interface when I configure it for an ipv4 address, whether I want
one or not. I.e. the command:

ifconfig eth0 inet 192.168.1.10 up

will cause both the ipv4 address and also an ipv6 address to
materialise on eth0.

This was a problem for me, as I have a Java application which sets
the QoS/ToS bits on outgoing packets. All of a sudden that stopped
working, because the application switched over to using ipv6 sockets
on this new system. I've read that the Java folk are quite proud of
themselves for having Java use both ipv4 and ipv6 stacks by default
where both are set up on a system. And it looks like either Java -
or Linux? - can't set ToS for ipv6?

If I do an 'ifconfig eth0 del <ipv6 address>/<length>' to delete
the ipv6 address then the Java application works as it used to, stuck
back in ipv4 land.

My question is - how can I stop ifconfig from setting up an ipv6
address *automatically*? I can't see any obvious 'do not set up ipv6
by default' option in its man page. I thought by specifying 'inet'
explicitly when I 'up' it, as per my example command above,
would stop it from adding the ipv6 address ... but it doesn't. So
my startup scripts have to be a bit less elegant and run ifconfig
a second time to delete the ipv6 address once it's added the ipv4
address. I would have hoped there was a way to stop ifconfig from
doing its ipv6 thing.

As a second question, out of curiosity, can anyone give me tips
on why my Java program can't set ToS when it's using ipv6 (by
default)? I wrote a simple test client in Java that simply creates
a socket to an echo daemon and sets ToS (by calling the method
'socket.setTrafficClass (0x08)'). Using strace I could see it
do this when the ipv6 address was up on the interface:

getsockname(4, {sa_family=AF_INET6, sin6_port=htons(35100),
inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0,
sin6_scope_id=0}, [28]) = 0
setsockopt(4, SOL_IPV6, 0x21 /* IPV6_??? */, [1], 4) = 0

Which was nicely different from the AF_INET ipv4 calls it used to
do, as a contrast. Is that setsockopt() correct, or have the Java
folk messed up? I know nothing about ipv6, but I would have assumed
there was some sort of ToS/QoS equivalent?

Thanks,


Brad
 
Reply With Quote
 
 
 
 
Philippe Weill
Guest
Posts: n/a

 
      02-28-2008, 07:57 AM
Brad wrote:

> My question is - how can I stop ifconfig from setting up an ipv6
> address *automatically*? I can't see any obvious 'do not set up ipv6
> by default' option in its man page. I thought by specifying 'inet'


I don't no slackware but on rh and derived , mandriva ...

you could put in interface configuration

NETWORKING_IPV6= false


and you could put in /etc/modprobe.conf

ailas net-pf-10 off
 
Reply With Quote
 
Brad
Guest
Posts: n/a

 
      02-28-2008, 10:21 AM
Philippe Weill wrote:
> Brad wrote:
>
>> My question is - how can I stop ifconfig from setting up an ipv6
>> address *automatically*? I can't see any obvious 'do not set up ipv6
>> by default' option in its man page. I thought by specifying 'inet'

>
> you could put in interface configuration
>
> NETWORKING_IPV6= false
>
> and you could put in /etc/modprobe.conf
>
> ailas net-pf-10 off


I guess I could do that; cut it off at the source! Either disable
ipv6 when I compile the kernel, or ensure that the ipv6 module
isn't loaded.

It just seems to me that it would have been nice to have an option
to tell ifconfig to ignore ipv6 for a particular interface, rather
than wait for it to attach the ipv6 address and then have to delete it.

After posting this I did some more research and discovered that a
formal bug has been raised for the Java problem - bug ID 4792724,
since December 2002, still 'in progress'! So that's confirmed.


Brad
 
Reply With Quote
 
buck
Guest
Posts: n/a

 
      02-28-2008, 06:18 PM
On Thu, 28 Feb 2008 13:18:05 +1000, Brad <(E-Mail Removed)> wrote:

>Hi. I'm running Linux 2.6.23.14 with Slackware 12.0 and have had
>my first exposure to ipv6. It seems that ifconfig (from net-tools
>1.60) will automatically assign an ipv6 address to my ethernet
>interface when I configure it for an ipv4 address, whether I want
>one or not. I.e. the command:
>
> ifconfig eth0 inet 192.168.1.10 up
>
>will cause both the ipv4 address and also an ipv6 address to
>materialise on eth0.


I suggest that you post this question in alt.os.linux.slackware or
alt.linux.slakware.

This does not happen to me when I use rc.inet1 and rc.inet1.conf,
regardless of static or DHCP IP, and I have not done anything that
would discourage IPv6 other than to remove all references to it from
the netfilter/iptables stuff in the kernel.

Another alternative might be to use ip rather than ifconfig.
--
buck

 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      02-28-2008, 11:48 PM
Hello,

Brad a écrit :
> Hi. I'm running Linux 2.6.23.14 with Slackware 12.0 and have had
> my first exposure to ipv6. It seems that ifconfig (from net-tools
> 1.60) will automatically assign an ipv6 address to my ethernet
> interface when I configure it for an ipv4 address, whether I want
> one or not.


Is it an IPv6 link-local address, starting with fe80 ?
ifconfig is not responsible for this. The IPv6 stack is. It
automatically adds a link local address to an IPv6-capable interface
when the interface is brought up.

> This was a problem for me, as I have a Java application which sets
> the QoS/ToS bits on outgoing packets. All of a sudden that stopped
> working, because the application switched over to using ipv6 sockets
> on this new system. I've read that the Java folk are quite proud of
> themselves for having Java use both ipv4 and ipv6 stacks by default
> where both are set up on a system. And it looks like either Java -
> or Linux? - can't set ToS for ipv6?


What has changed ? Is it your system or Java that did not support IPv6
before ?

> If I do an 'ifconfig eth0 del <ipv6 address>/<length>' to delete
> the ipv6 address then the Java application works as it used to, stuck
> back in ipv4 land.


I must say I'm a bit puzzled by this.
By default Linux allows using an IPv6 socket for IPv4 communications.
You could try disabling this by setting the net.ipv6.bindv6only sysctl to 0.

I wrote a simple test client in Java that simply creates
> a socket to an echo daemon and sets ToS (by calling the method
> 'socket.setTrafficClass (0x08)'). Using strace I could see it
> do this when the ipv6 address was up on the interface:
>
> getsockname(4, {sa_family=AF_INET6, sin6_port=htons(35100),
> inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0,
> sin6_scope_id=0}, [28]) = 0
> setsockopt(4, SOL_IPV6, 0x21 /* IPV6_??? */, [1], 4) = 0


What was the destination address of the echo service specified in the
socket ?

> Which was nicely different from the AF_INET ipv4 calls it used to
> do, as a contrast. Is that setsockopt() correct, or have the Java
> folk messed up? I know nothing about ipv6, but I would have assumed
> there was some sort of ToS/QoS equivalent?


The IPv6 header has a "Traffic Class" field.
 
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
IPv6 address not connecting but IPv4-mapped -IPv6 does. Please help. DanielJohnson Network Routers 0 01-07-2009 12:10 AM
Windows XP/2003 IPv6 ISATAP tunnel Server stop forwarding after re Colin Windows Networking 0 04-22-2008 11:42 AM
howto check ip address in shell without using ifconfig? Yinghe Chen Linux Networking 4 08-23-2007 07:41 AM
IPv6 infrastructure for Global and/or Site Specific IPv6 address JackFlash Windows Networking 1 06-25-2007 03:11 PM
difference between ip and ifconfig for ipv6 configuration PArthiv Linux Networking 0 12-11-2003 02:33 AM



1 2 3 4 5 6 7 8 9 10 11