Linux Scroll

Just another WordPress.com site

ifconfig command

ifconfig – configure a network interface

Display info on all network interfaces:

$ ifconfig -a

* eth0 – Network card
* wlan0 – Wireless network card

Display current config for eth0:

$ ifconfig eth0

Activate eth0:

$ ifconfig eth0 up

Deactivate eth0:

$ ifconfig eth0 down

Assign IP address:

$ ifconfig eth0 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255

Assign default gateway:

$ route add default gw 192.168.1.254

Assign multiple IP’s:

$ ifconfig eth0:0 192.168.1.2

$ ifconfig eth0:1 192.168.1.3

View current routing table:

$ route -n

# netstat -rn
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: