Network

To view the route table
netstat -r

To view the route table from the ODM DB
lsattr -EHl inet0 -a route

Temporarily add a default route
route add default 192.168.1.1

Temporarily add an address to an interface
ifconfig en0 192.168.1.2 netmask 255.255.255.0

Temporarily add an alias to an interface
ifconfig en0 192.168.1.3 netmask 255.255.255.0 alias

To Delete Alias from en1
ifconfig en1 10.35.0.171 netmask 255.255.128.0 delete

To Create Alias to en2
ifconfig en2 10.35.0.171 netmask 255.255.128.0 alias

To permanently add an IP address to the en1 interface
chdev -l en1 -a netaddr=192.168.1.1 -a netmask=0xffffff00

Permanently add an alias to an interface
chdev -l en0 -a alias4=192.168.1.3,255.255.255.0

Remove a permanently added alias from an interface
chdev -l en0 -a delalias4=192.168.1.3,255.255.255.0

List ODM (next boot) IP configuration for interface
lsattr -El en0

Permanently set the hostname
chdev -l inet0 -a hostname=www.yourdomain.net

Turn on routing by putting this in rc.net
no -o ipforwarding=1

List networking devices
lsdev -Cc tcpip

List Network Interfaces
lsdev -Cc if

List attributes of inet0
lsattr -Ehl inet0

List (physical layer) attributes of ent0
lsattr -El ent0

List (networking layer) attributes of en0
lsattr -El en0

Speed is found through the entX device
lsattr -El ent0 -a media speed

Set the ent0 link to Gig full duplex
(Auto Negotiation is another option)
chdev -l ent0 -a media speed=1000 Full Duplex -P

Turn off Interface Specific Network Options
no -p -o use isno=0

Get (long) statistics for the ent0 device (no -d is shorter)
entstat -d ent0

List all open, and in use TCP and UDP ports
netstat -anf inet

List all LISTENing TCP ports
netstat -na |grep LISTEN

Remove all TCP/IP configuration from a host
rmtcpip

No comments:

Post a Comment