Common Linux IP commands

Commands commonly used in modifying or listing the network cards.

Display current configuration for all NIC’s


Display current configuration for eth0

ifconfig eth0

Assign IP address

ifconfig eth0


ping -c 3

Assign multiple IP’s

ifconfig eth0:0

Assign second IP

ifconfig eth0:1

Disable network card

ifconfig eth0 down

Enable network card

ifconfig eth0 up

View current routing table

route -n

View arp cache

arp “or” arp -n

Assign IP/Subnet

ifconfig eth0 netmask

Assign default gateway

route add default gw

Trace Route


Trace Path


DNS test


Advanced DNS test


Reverse lookup


Advanced reverse lookup

dig -x

Note: You must have root privileges to make any changes. Network cards are reffered to as ethX where X are based on the position on the PCI bay e.g. eth0, eth1, etc..

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.