Show all network info

Is there a command that display all network info. I'm looking for ip address, subnet mask, gateway, and dns. If there isn't a single command could someone please write me a shellscript that can do this?

ifconfig -a

depends on the OS type & version, but with 'ifconfig -a' and 'netstat -rn' you should be able to script something that works almost everywhere....

Don't forget the routing table for gateways. route -n And /etc/resolv.conf for DNS servers(solaris uses something different but I'm not positive what).

Of course there's plenty of more complicated network setups than just IP/netmask/gateway/DNS.

Thank you. What's the difference between inet addr and Bcast. I thought Bcast was the gateway for awhile and I just figured out it wasn't when you pointed out the route command.

Thank you. I use Fedora. Could you write me a shellscript that checks all this please?

#!/bin/sh

/sbin/ifconfig -a
cat /etc/resolv.conf
/sbin/route -n
/sbin/arp -n

You can add these to the list (assuming Solaris 10 for dladm):

cat /etc/nsswitch.conf
dladm show-dev
dladm show-link
ndd interface parameter

and on OpenSolaris based distributions / Solaris 11 Express and newer:

dladm show-phys 
dladm show-aggr
dladm show-bridge
dladm show-vlan
dladm show-wifi
dladm show-ether
dladm show-linkprop
dladm show-secobj
dladm show-vnic
dladm show-etherstub
dladm show-iptun
dladm show-part
dladm show-ib

ipadm show-if
ipadm show-ifprop
ipadm show-addr
ipadm show-addrprop
ipadm show-prop

Thank you. What's the difference between inet addr and Bcast.

I unfortunately use fedora.

One is the IP address of the network adapter. The other is the network address which would broadcast to everything on the local network.