The table below provides an approximate mapping of various ifconfig(1m) features to ipadm(1m) subcommands.

ifconfig(1m)ipadm(1m)
plumb/unplumb ipadm create-if
ipadm delete-if
[address [/prefix_length] [dest_address]] [addif address [/prefix_length]]
[removeif address [/prefix_length]] [netmask mask] [destination dest_address]
{auto-dhcp | dhcp} [primary] [wait seconds] extend | release | start 
ipadm create-addr -T static
ipadm create-addr -T dhcp
ipadm create-addr -T addrconf
ipadm show-addr
ipadm delete-addr
ipadm refresh-addr
[deprecated | -deprecated] [preferred | -preferred]
[private | -private] [zone zonename | - zone | -all-zones]
[xmit | -xmit] 
ipadm set-addrprop
ipadm show-addrprop
[up] ipadm enable-addr
[down] ipadm disable-addr
[metric n] [mtu n] [nud | -nud]
[arp | -arp] [usesrc [name | none]]
[router | -router] 
ipadm set-ifprop
ipadm show-ifprop
ipadm reset-ifprop
[ipmp] [group [name | ""]] [standby | -standby] [failover | -failover] ipadm *-ipmp set of subcommands.
These subcommands will not be supported in the first release of ipadm.
[tdst tunnel_dest_address] [tsrc tunnel_src_address] [encaplimit n | -encaplimit] [thoplimit n] dladm *-iptun set of subcommands from Clearview IP tunneling project
[auth_algs authentication algorithm] [encr_algs encryption algorithm]
[encr_auth_algs authentication algorithm] 
ipsecconf(1m)
[auto-revarp] [ether [address]] [index if_index]
[subnet subnet_address] [broadcast address]
[token address/prefix_length]
dhcp options - inform, ping, release, status, drop 
No equivalent subcommand yet
[modlist] [modinsert mod_name@pos] [modremove mod_name@pos] No equivalent subcommand yet
ifconfigipadm
Creating interfaces

bash-3.2# ifconfig bge1 plumb up
bash-3.2# ifconfig bge1 inet6 plumb up
bash-3.2# ifconfig bge1 
bge1: flags=1100843 mtu 1500 index 54 
     inet 0.0.0.0 netmask ff000000  
     ether 0:3:ba:44:3d:35 
bash-3.2# ifconfig bge1 inet6
     bge1: flags=2100841 mtu 1500 index 54 
     inet6 fe80::203:baff:fe44:3d35/10

bash-3.2# ipadm create-if bge1
bash-3.2# ipadm show-if bge1
INTF       STATE    MTU        FLAGS
bge1       ok       1500       mcast,bcast
Note: ipadm plumbs both IPv4 and IPv6 interfaces by default. 
One can use the -f flag to override this behavior.
Deleting Interfaces

bash-3.2# ifconfig bge1 unplumb
bash-3.2# ifconfig bge1 inet6 unplumb

bash-3.2# ipadm delete-if bge1
Note: ipadm unplumbs both IPv4 and IPv6 interfaces by default. 
One can use the -f flag to override the above behavior
Adding Static IPv4 Addresses

bash-3.2# ifconfig bge1 plumb 
bash-3.2# ifconfig bge1 10.10.1.2/24 up
bash-3.2# ifconfig -a
bge1: flags=1000843 mtu 1500 index 7
     inet 10.10.1.2 netmask ffffff00 broadcast 10.10.1.255
     ether 0:3:ba:44:4f:a9

bash-3.2# ipadm create-addr -T static -a local=10.10.1.2/24 bge1/v4addr
bash-3.2# ipadm show-addr -i bge1
OBJECT        ORIGIN   STATE       FLAGS   ADDR
bge1/v4addr   static   preferred   ---     10.10.1.2/24

bash-3.2# ipadm show-addr bge1/v4addr
OBJECT        ORIGIN   STATE       FLAGS   ADDR
bge1/v4addr   static   preferred   ---     10.10.1.2/24
Note: Creating the bge1 interface explicitly is not required. 
The ipadm create-addr syntax implicitly creates the interface 
if it is not yet created.
Adding static IPv6 addresses. Note: Link local addresses must first be configured on the interface before any static IPv6 addresses can be configured.

* Create a link-local and any stateless/stateful 
address.
bash-3.2# ifconfig bge1 inet6 plumb

* Create a new logical interface bge1:2.
bash-3.2# ifconfig bge1 inet6 addif 2002::1234 up
bash-3.2# ifconfig -a
bge1: flags=1000843 mtu 1500 index 7
     inet 10.10.1.2 netmask ffffff00 broadcast 10.10.1.255
     ether 0:3:ba:44:4f:a9 bge1: flags=2000841 mtu 1500 index 7
     inet6 fe80::203:baff:fe44:4fa9/10
     ether 0:3:ba:44:4f:a9 bge1:1: flags=20a0841 mtu 1500 index 7
     inet6 subnet 2002:a08:39f0:3::/64 bge1:2: flags=2000840 mtu 1500 index 7
     inet6 2002::1234/64

* Create a link-local and any stateless/stateful 
address.
bash-3.2# ipadm create-addr -T addrconf bge1/v6auto-addr

bash-3.2# ipadm create-addr -T static -a local=2002::1234/64 bge1/v6addr
bash-3.2# ipadm show-addr -i bge1
OBJECT           ORIGIN   STATE    FLAGS ADDR
bge1/v4addr      static   preferred ---  10.10.1.2/24
bge1/v6auto-addr addrconf preferred ---  fe80::203:baff:fe44:3d35/10
bge1/v6auto-addr addrconf preferred ---  2002:a08:39f0:3:203:baff:fe44:3d35/64
bge1/v6addr      static   preferred ---  2002::1234/64
Creating an IPv4 dhcp-controlled address

bash-3.2# ifconfig bge1 plumb
bash-3.2# ifconfig bge1 dhcp start
bash-3.2# ifconfig bge1
bge0: flags=1004843 mtu 1500 index 2
     inet 10.8.48.170 netmask ffffff80 broadcast 10.8.48.255
     ether 0:3:ba:44:4f:a8

* Extend the lease of a dhcpv4 address.
bash-3.2# ifconfig bge1 dhcp extend

* Drop the address.
bash-3.2# ifconfig bge1 dhcp drop

* Release the address.
bash-3.2# ifconfig bge1 dhcp release

bash-3.2# ipadm create-addr -T dhcp bge1/dhcpaddr
bash-3.2# ipadm show-addr bge1/dhcpaddr
OBJECT          ORIGIN   STATE        FLAGS     ADDR
bge1/dhcpaddr   dhcp     preferred    ~---       10.8.48.242/25

* Extend the lease of a dhcpv4 address.
bash-3.2# ipadm refresh-addr bge1/dhcpaddr

* Drop the dhcp address.
bash-3.2# ipadm delete-addr bge1/dhcpaddr

* Release the address.
bash-3.2# ipadm delete-addr -r bge1/dhcpaddr
Deleting Addresses

* Remove all the addresses on the IPv4 interface.
bash-3.2# ifconfig bge1 unplumb

* Remove only the 2002::1234 interface.
bash-3.2# ifconfig bge1 inet6 removeif 2002::1234

* Remove the link-local, stateless address 
and all other addresses.
bash-3.2# ifconfig bge1 inet6 unplumb

bash-3.2# ipadm delete-addr bge1/v4addr
bash-3.2# ipadm delete-addr bge1/v6addr
bash-3.2# ipadm delete-addr bge1/v6auto-addr

* Drop the dhcp address.
bash-3.2# ipadm delete-addr bge1/dhcpaddr
Setting interfaces/address properties

* Enable forwarding on both IPv4 and IPv6 interfaces.
bash-3.2# ifconfig bge1 router
bash-3.2# ifconfig bge1 inet6 router

* Enable arp/nud on IPv4/IPv6 interfaces
bash-3.2# ifconfig bge1 arp
bash-3.2# ifconfig bge1 inet6 nud

* Disable forwarding on both IPv4 and IPv6 interfaces.
bash-3.2# ifconfig bge1 -router
bash-3.2# ifconfig bge1 inet6 -router

* Disable arp/nud on IPv4/IPv6 interfaces.
bash-3.2# ifconfig bge1 -arp
bash-3.2# ifconfig bge1 inet6 -nud

* Change the netmask on an address.
bash-3.2# ifconfig bge1:1 netmask 255.255.255.248

* Enable forwarding on both IPv4 and IPv6 interfaces.
bash-3.2# ipadm set-ifprop -p forwarding=yes bge1

* Enable arp/nud on IPv4/IPv6 interfaces.
bash-3.2# ipadm set-ifprop -f inet -p arp=yes bge1
bash-3.2# ipadm set-ifprop -f inet6 -p nud=yes bge1

* Disable forwarding on both IPv4 and IPv6 interfaces.
bash-3.2# ipadm set-ifprop -p forwarding=no bge1

* Enable arp/nud on IPv4/IPv6 interfaces.
bash-3.2# ipadm set-ifprop -f inet -p arp=no bge1
bash-3.2# ipadm set-ifprop -f inet6 -p nud=no bge1

* Change the netmask on an address.
bash-3.2# ipadm set-addrprop -p prefixlen=30 bge1/v4addr
last modified by rrc_1956 on 2009/11/13 23:58
Collectives
Project


© Sun Microsystems Inc. 2009
XWiki Enterprise 1.8.2.19075 - Documentation
Terms Of Use | Privacy | Trademarks | Copyright Policy | Site Guidelines | Site map | Help
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.