Wednesday, 23 February 2011

Linux IP Commands

Display Current Config for all NIC's: ifconfig

Display Current Config for eth0: ifconfig eth0

Assign IP: ifconfig eth0 209.85.149.147

Ping: ping -c 3 209.85.149.147

Assign multiple IP's: ifconfig eth0:0 209.85.149.147

Assign second IP: ifconfig eth0:1 209.85.149.147

Disable network card: ifconfig eth0 down

Enable network card: ifconfig eth0 up

View current routing table: route "or" route -n

View arp cache: arp "or" arp -n

Assign IP/Subnet: ifconfig eth0 209.85.149.147 netmask 209.85.149.00

Assign Default Gateway: route add default gw 209.85.149.147

Trace Route: traceroute www.google.com

Trace Path: tracepath www.google.com

DNS Test: host www.google.com

Advanced DNS Test: dig www.google.com

Reverse Lookup: host 209.85.149.147

Advanced Reverse Lookup: dig -x 209.85.149.147

*You MUST be at the ROOT user to make/save any changes. Linux users, your distribution will determine the location of your network config file which will need to be updated and saved in order for the changes to remain in effect after rebooting. Network cards are referred to as eth0, eth1, eth2, etc based on their position on the PCI bus.

(Source: WhatsMyIP)

No comments:

Post a Comment