System Administration Guide: IP Services

ifconfig Command Extensions for IPv6 Support

The ifconfig command enables IPv6 interfaces and the tunneling module to be plumbed. ifconfig uses an extended set of ioctls to configure both IPv4 and IPv6 network interfaces. The following describes ifconfig options that support IPv6 operations. See Monitoring the Interface Configuration With the ifconfig Command for a range of both IPv4 and IPv6 tasks that involve ifconfig.

index

Sets the interface index.

tsrc/tdst

Sets the tunnel source or destination.

addif

Creates the next available logical interface.

removeif

Deletes a logical interface with a specific IP address.

destination

Sets the point-to-point destination address for an interface.

set

Sets an address, netmask, or both for an interface.

subnet

Sets the subnet address of an interface.

xmit/-xmit

Enables or disables packet transmission on an interface.

Chapter 7, Configuring an IPv6 Network (Tasks) provides IPv6 configuration procedures.


Example 11–6 Adding a Logical IPv6 Interface With the -addif Option of the ifconfig Command

The following form of the ifconfig command creates the hme0:3 logical interface:


# ifconfig hme0 inet6 addif up
Created new logical interface hme0:3

This form of ifconfig verifies the creation of the new interface:


# ifconfig hme0:3 inet6
hme0:3: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2
		inet6  inet6 fe80::203:baff:fe11:b321/10


Example 11–7 Removing a Logical IPv6 Interface With the -removeif Option of the ifconfig Command

The following form of the ifconfig command removes the hme0:3 logical interface.


# ifconfig hme0:3 inet6 down

# ifconfig hme0 inet6 removeif 1234::5678


Example 11–8 Using ifconfig to Configure an IPv6 Tunnel Source


# ifconfig ip.tun0 inet6 plumb index 13

Opens the tunnel to be associated with the physical interface name.


# ifconfig ip.tun0 inet6
ip.tun0: flags=2200850<POINTOPOINT,RUNNING,MULTICAST,NONUD,
#IPv6> mtu 1480 index 13
		inet tunnel src 0.0.0.0 
		inet6 fe80::/10 --> :: 

Configures the streams that are needed for TCP/IP to use the tunnel device and report the status of the device.


# ifconfig ip.tun0 inet6 tsrc 120.46.86.158 tdst 120.46.86.122

Configures the source and the destination address for the tunnel.


# ifconfig ip.tun0 inet6
ip.tun0: flags=2200850<POINTOPOINT,RUNNING,MULTICAST,NONUD,
IPv6> mtu 1480 index 13
		inet tunnel src 120.46.86.158  tunnel dst 120.46.86.122
		inet6 fe80::8192:569e/10 --> fe80::8192:567a

Reports the new status of the device after the configuration.



Example 11–9 Configuring a 6to4 Tunnel Through ifconfig (Long Form)

This example of a 6to4 pseudo-interface configuration uses the subnet ID of 1 and specifies the host ID, in hexadecimal form.


# ifconfig ip.6to4tun0 inet6 plumb
# ifconfig ip.6to4tun0 inet tsrc 129.146.86.187 \
2002:8192:56bb:1::8192:56bb/64 up

# ifconfig ip.6to4tun0 inet6
ip.6to4tun0: flags=2200041<UP,RUNNING,NONUD,IPv6>mtu 1480 index 11
        inet tunnel src 129.146.86.187 
        tunnel hop limit 60 
        inet6 2002:8192:56bb:1::8192:56bb/64 


Example 11–10 Configuring a 6to4 Tunnel Through ifconfig (Short Form)

This example shows the short form for configuring a 6to4 tunnel.


# ifconfig ip.6to4tun0 inet6 plumb
# ifconfig ip.6to4tun0 inet tsrc 129.146.86.187 up

# ifconfig ip.6to4tun0 inet6
ip.6to4tun0: flags=2200041<UP,RUNNING,NONUD,IPv6>mtu 1480 index 11
        inet tunnel src 129.146.86.187 
        tunnel hop limit 60 
        inet6 2002:8192:56bb::1/64