Setting a persistent fixed IPv6 address

Hello folks,

I've been trying to configure one of a node's interfaces with a fixed, globally routable, IPv6 address.

The method I've used is:

######################################################

# Create a logical interface for e1000g0

# e1000g0 has a link-local address

touch /etc/hostname6.e1000g0:1

#Add one line containing: myHostName

vi /etc/hostname6.e1000g0:1

#Add one line to hosts file with the IPv6 address

#The line contains: 2001:db8:ffff::1myHostName

vi /etc/inet/hosts

#Add the same line to /etc/inet/ipnodes

######################################################

On rebooting, the result was:

"Failed to configure IPv6 interface(s): e1000g0:1"

Does anyone have a clue about how to set a persistent IPv6 address on an interface?

Solaris 10 guide 816-4554 (System Administration Guide- IP Services) doesn't give any information that I can use. http://forum.java.sun.com/thread.jspa?threadID=5108733&tstart=90 comes closest but it's not accurate or clear.

Cheers,

Etienne

[1115 byte] By [edepasa] at [2007-11-27 6:51:12]
# 1
I should have added that the commandifconfig e1000g0:1 inet6 plumb 2001:dbe:ffff::1/126 upworks well when added from the command line. Naturally, it doesn't persist after reboot.
edepasa at 2007-7-12 18:25:29 > top of Java-index,General,Network Configurations...
# 2

> I should have added that the command

>

> ifconfig e1000g0:1 inet6 plumb 2001:dbe:ffff::1/126

> up

>

> works well when added from the command line.

> Naturally, it doesn't persist after reboot.

Same way you do an IPv4 address, except the filename is /etc/hostname6.<int> instead of /etc/hostname.<int>

I think technically prior to Nevada, IPv6 names should go only in /etc/inet/ipnodes, but I don't think having it in /etc/hosts will hurt too many things. They'll go in /etc/hosts in the future, so it would be nice to find if anything freaks out about it.

--

Darren

Darren_Dunhama at 2007-7-12 18:25:29 > top of Java-index,General,Network Configurations...
# 3
Thanks for the feedback, Darren.Isn't what you are suggesting the same as I've written in my first post, or are you referring to something extra?
edepasa at 2007-7-12 18:25:29 > top of Java-index,General,Network Configurations...
# 4

You have tested that you can activate the address manually, but you put a name in the interface file, not that address. Did you test that you can activate that name manually?

In current versions of Solaris, /etc/hosts is for IPv4 addresses only. You have to put IPv6 addresses in /etc/inet/ipnodes.

I was getting ahead of myself by saying it shouldn't hurt anything to have it in /etc/hosts, but I meant *also* have it there. In fact, you may find it easier to just link the two files together so you don't forget to edit them.

There are some reasons not to do this, but I think it's the direction that Nevada and future version are headed.

--

Darren

Darren_Dunhama at 2007-7-12 18:25:29 > top of Java-index,General,Network Configurations...
# 5

Thanks Darren, I've succeeded.

To summarise:

1. In /etc/hostname6.e1000g0:1, I added the following line:

2001:db8:ffff::1/126

2. In /etc/inet/ipnodes, I added the line:

myHostName2001:db8:ffff::1/126

3. From /etc/inet/hosts, I removed references to any IPv6 address. Possibly, this third step is unnecessary.

I rebooted to verify acceptance and now I have my IPv6 address attached to my logical interface e1000g0:1.

Cheers,

Etienne

edepasa at 2007-7-12 18:25:29 > top of Java-index,General,Network Configurations...
# 6

> Thanks Darren, I've succeeded.

>

> To summarise:

>

> 1. In /etc/hostname6.e1000g0:1, I added the following

> line:

> 2001:db8:ffff::1/126

This usually contains a hostname or an IP address. By placing an address in here, you're hardcoding it and items in hosts/ipnodes are ignored.

> 2. In /etc/inet/ipnodes, I added the line:

> myHostName2001:db8:ffff::1/126

This isn't used now because you've harcoded an address in the interface file.

This isn't wrong, but most folks prefer to use hostnames rather than addresses in the interface files.

> 3. From /etc/inet/hosts, I removed references to any

> IPv6 address. Possibly, this third step is

> unnecessary.

Probably true.

--

Darren

Darren_Dunhama at 2007-7-12 18:25:29 > top of Java-index,General,Network Configurations...
# 7

>This isn't wrong, but most folks prefer to use hostnames rather than >addresses in the interface files.

But this is a re-visitation of the same issue I raised in my first post in this thread: if a hostname is placed in the /etc/hostname6.e1000g0:1 file, and the associated IPv6 address placed in /etc/inet/ipnodes alongside the name given in /etc/hostname6.e1000g0:1, then Solaris 10 11/06 replies with:

"Failed to configure IPv6 interface(s): e1000g0:1"

Plainly speaking, although putting a name in the /etc/hostname.e1000g0 works for IPv4, it does not work in the same way for IPv6 on Solaris 10 11/06.

>This isn't used now because you've harcoded an address in the >interface file.

I'll try and find some time to verify this.

Thanks again.

Cheers,

Etienne

edepasa at 2007-7-12 18:25:29 > top of Java-index,General,Network Configurations...
# 8

> >This isn't wrong, but most folks prefer to use

> hostnames rather than >addresses in the interface

> files.

>

> But this is a re-visitation of the same issue I

> raised in my first post in this thread: if a hostname

> is placed in the /etc/hostname6.e1000g0:1 file, and

> the associated IPv6 address placed in

> /etc/inet/ipnodes alongside the name given in

> /etc/hostname6.e1000g0:1, then Solaris 10 11/06

> replies with:

Your first message says only that it was placed in /etc/hosts, not /etc/inet/ipnodes. IPv6 names/addresses are not recognized in /etc/hosts.

Also, do you have a /etc/hostname6.e1000g0? The IPv6 and IPv4 interfaces are somewhat separate. So I would probably be bringing up the main interface (e1000g0) on IPv6 before trying to bring up a :1 subinterface.

> "Failed to configure IPv6 interface(s): e1000g0:1"

>

> Plainly speaking, although putting a name in the

> /etc/hostname.e1000g0 works for IPv4, it does not

> work in the same way for IPv6 on Solaris 10 11/06.

I am unable to reproduce this problem (but I'm not running 11/06). Placing a name in /etc/inet/ipnodes and populating /etc/hostname6.<int>0 with the name is enough to bring up the interface at boot for me.

# grep testhost /etc/inet/ipnodes

fe80::a000:1 testhost

# cat /etc/hostname6.hme0

testhost

# ifconfig hme0 inet6

hme0: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2

inet6 fe80::a000:1/128

--

Darren

Sorry, just now saw the ipnodes line in the initial message. Perhaps the use of :1 is causing the problem?

Should be able to run the startup scripts by hand to find where the problem line is if it's still occuring.

Message was edited by:

Darren_Dunham

Darren_Dunhama at 2007-7-12 18:25:29 > top of Java-index,General,Network Configurations...
# 9

"Also, do you have a /etc/hostname6.e1000g0? The IPv6 and IPv4 interfaces are somewhat separate. So I would probably be bringing up the main interface (e1000g0) on IPv6 before trying to bring up a :1 subinterface."

Yes, I do have the file /etc/hostname6.e1000g0. After installing Solaris 10 11/06 and indicating that IPv6 was to be enabled on this interface, an empty file was created by the installer and a link-local address got associated with the IPv6 interface e1000g0. To the best of my knowledge, a link-local address is the first address that is associated with an interface, so that address associates with interface e1000g0.

I created (logical) Interface e1000g0:1 at a later stage, in the process of converting the host to a router as indicated starting at page 153 of 816-4554 but I deviated from the procedure described there because my interface needed a fixed IP, not one assigned through an ICMP v6 Router Solicitation message. Which is what brought me to my first post...

Cheers,

Etienne

edepasa at 2007-7-12 18:25:29 > top of Java-index,General,Network Configurations...
# 10

Okay, can you do this operation by hand when there is a hostname in the /etc/hostname6.e1000g0:1 file and the same hostname in /etc/inet/ipnodes? Unplumb the interface then run:

# grep `cat /etc/hostname6.e100g0:1` /etc/inet/ipnodes

fe80::a0001:1 testhost2

# ifconfig e1000g0:1 inet6 plumb `cat /etc/hostname6.e1000g0:1` up

#

That works fine on the machine I'm testing (although I'm using an hme instead of e1000g).

That's most of what the startup scripts are doing, so if that works, so should the startup, and if it fails it should give more information about what's happening.

--

Darren

Darren_Dunhama at 2007-7-12 18:25:29 > top of Java-index,General,Network Configurations...