Seb, Meem and I were having a discussion about general
desirables from ipadm. Here's a summary, so that we
can continue the discussion with more input from
the Community.
We started off with the axiom that, as part of
finding a better alternative to ndd(1m), Brussels will
provide a tool "ipadm" which will be modeled after
dladm(1m). In other words ipadm will support basic
network-layer management and querying.
Here's a summary of the discussion. Note that the
sample output is fully fabricated with vi and has
been included only to help the discussion. Column
names are up for bashing (as long as we don't get
too distracted by the names!)
General desirables
------------------
- All commands will take dladm-like flags for persistence, parseable
output, column selection
- all the commands described here will have library entry points
from libipadm and libtranspadm
- for each command, the object being acted upon will be the last item
in the CLI. The command syntax will follow the <verb>-<object>
syntax currently being used for dladm(1m)
- Since IP deals with the ip-interface as the object being acted upon,
and doesn't deal with typical ULP info such as ports, whereas ULPs deal
with the Layer 4 proto as the object, a proposal on the table was to
have two tools
/sbin/ipadm that deals with adminstration of the ip layer protocols, and,
/sbin/transpadm (xpadm?) that deals with transport layer proto administration
While this allows a clean distinction for property management it
also raises the question of how we deal with icmp, arp, dhcp, ipsec
and other protocols that also exist at layer 2.
Let's assume, for now, that "ipadm" will deal with all the layer2 stuff,
though I'd be interested in hearing other thoughts for/against this
model.
- the initial delivery of ipadm and transpadm will cover basic features
and lay the foundations for future extensions for a more exhaustive
feature list.
Features that will be initially supported by ipadm
-------------------------------------------------
- Creating the physical interface
# ipadm create-interface <interface>
Plumbs the interface with address set to INADDR_ANY/unspec.
- Adding address to <interface>, using logical number <lnum>
# ipadm add-address [-l <lnum>] -a <address>/<mask> <interface>
If no <lnum> is specified, the lnum is implied to be 0.
Implementation detail: when lnum != 0, this is equivalent to the
current semantics of "ifconfig addif", i.e., a new ipif is created.
TBD: use "tag" or some other name to avoid any misconceptions
about logical interfaces?
- Deleting address on interface
# ipadm delete-address [-l <lnum>] -a <address>/<mask> <interface>
Implementation detail: when lnum != 0, this is equivalent to the
current semantics of "ifconfig removeif", i.e., the ipif is 'unplumbed'
- show IP state of interface:
# ipadm show-address <interface>
Sample output (fabricated using vi for the sake of discussion only.
I'm not particularly attached to any of the field names. Format of
output is up for bashing as well, though I would prefer to focus
primarily on overall content rather than nits)
INTF LNUM FLAGS ADDRTYPE STATE ADDR/MASK
e1000g0 0 CBM D UP 192.168.16.185/24
lo0 0 LMV S UP 127.0.0.1/8
ipmp0 0 BMC IDd UP 192.168.16.8/24
qfe0 0 BMC iSt UP 192.168.16.18/24
bge0 0 MC A UP fe80::203:baff:fe44:3ddc/10
bge0 1 MC A UP 2002:a08:39f0:1:203:baff:fe44:3ddc/64
Key:
Flags: Addrtype
C: CoS D: dhcp
B: Broadcast S: static
L: Loopback A: addrconf
M: Multicast d: IPMP data addr
V: Virtual t: IPMP test address
M: Multicast
I: IPMP meta-interface
i: ipmp under-interface
Questions:
- what about point-to-point interfaces? One thought: list local/remote
addrs of point-to-point interfaces on 2 lines, with addrtype
specifiying "l" and "r".
- Property/tunable management:
# ipadm {set,get}-module-prop -p <name>=<value> [<interface>]
If no <interface> is specified, the property is set for all active
interfaces.
Sample output columns would be:
INTF PROPERTY PERMS VALUE DEFAULT POSSIBLE
Features supported by transpadm
-------------------------------
- Properties:
# transpadm {set,get}-prop -p <name>=<value> <transport-proto>
<transport-proto> == tcp, udp, sctp etc.
whose output columns would be:
TRANSP-PROTO PROPERTY PERMS VALUE DEFAULT POSSIBLE