Linux ifconfig cheat sheet

ifconfig

Bring interface up

ifconfig eth0 up

Bring interface down

ifconfig eth0 down

Assign IP to device eth0

ifconfig eth0 192.168.0.2

Assign IP to device including netmask and broadcast

ifconfig eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.1

Add IP as alias

ifconfig eth0:1 192.168.1.2

 Share!