Misc. network commands

Just a collection of semi-usefull commands.

lsdev -Cc if – Lists all available/defined network interfaces

chdev -l (device name) -a hostname=(hostname) – Changes hostname permanently

ifconfig (device name) detach – Removes the network card from the network interface list

ifconfig lo0 alias – Create alias ip address for loopback

route (add/delete) (-net/-host) (destination) (gateway) – Adds or deletes routes to other networks or hosts, does not update the ODM database and will be lost at reboot.
route add -net

chdev -l en0 -a “net,-hopcount,1,-netmask,netmask,destination,gateway” – Adds a route and adds entry into ODM, route survives a reboot.
chdev -l en0 -a “net,-hopcount,1,-netmask,,,”

route -rn – Display route table.

odmget -q “attribute=route” CuAt – Displays routes in the ODM.

lsattr -EHl en0 – Displays routes set in ODM and hostname

odmget -q “name=en0” CuAt – Displays routes set in ODM and hostname

netstat -i – Displays interface statistics

entstat -d (ethernet adapter eg en0) – Displays ethernet statistics

arp -a – Displays ip to mac address table from arp cache

stopsrc -g tcpip – Stops all running TCP/IP daemons

/etc/tcp.clean – Stops all running TCP/IP daemons and removes all lock files

/etc/rc.tcpip – Start all TCP/IP daemons. Do not use startsrc -g tcpip as this will start all TCP/IP daemons including routed & gated

Leave a Reply

Your email address will not be published. Required fields are marked *