System Administration Guide, Volume 3

Examples--New ifconfig Utility Options

The following usage of the ifconfig command creates the hme0:3 logical interface to the 1234::5678/64 IPv6 address and enables it with the up option, reports its status, disables it, then deletes the interface.


Example 16-1 Examples--Using addif and removeif


# ifconfig hme0 inet6 addif 1234::5678/64 up
Created new logical interface hme0:3

# ifconfig hme0:3 inet6
hme0:3: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2
		inet6 1234::5678/64 

# ifconfig hme0:3 inet6 down

# ifconfig hme0 inet6 removeif 1234::5678

The following usage of the ifconfig command opens the device associated with the physical interface name and sets up the streams needed for TCP/IP to use the device, reports its status, configures the tunnels source and destination address, and reports its new status after the configuration.


Example 16-2 Examples--Using tsrc/tdst and index


# ifconfig ip.tun0 inet6 plumb index 13

# 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 --> :: 

# ifconfig ip.tun0 inet6 tsrc 120.46.86.158 tdst 120.46.86.122

# 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