Re: Stop ifconfig from adding an ipv6 address?
- From: Pascal Hambourg <boite-a-spam@xxxxxxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 01:48:48 +0100
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.
.
- References:
- Stop ifconfig from adding an ipv6 address?
- From: Brad
- Stop ifconfig from adding an ipv6 address?
- Prev by Date: Re: ipv6 routing and neighbour discovery
- Next by Date: Re: linux failover (redundant internet/dial backup)
- Previous by thread: Re: Stop ifconfig from adding an ipv6 address?
- Next by thread: lp (lpd) to cups migration
- Index(es):
Relevant Pages
|