Feel free to skip ahead to the ip section.ifconfig
ifconfig is used to configure a network interface. You can use it to do the
following:
Activate or deactivate your NIC or change your NIC’s mode
Change your machine’s IP address, netmask, or broadcast address
Create an IP alias to allow more than one IP address on your NIC
Set a destination address for a point-to-point connectionYou can change as many or as few of these options as you want with a single
command. The basic structure for the command is as follows:
Click here to view code image
ifconfig [network device] options
Table 18.1 shows a subset of ifconfig options and examples of their uses.
Table 18.1 ifconfig Options
Use Option ExampleCreate alias [network device] ifconfig eth0:0_:[number]10.10.10.10Change IP
addressifconfig eth0 10.10.10.12Change the
netmasknetmask [netmask] ifconfig eth0 netmask
255.255.255.0Change the
broadcastbroadcast [address]ifconfig eth0 broadcast
10.10.10.255Take
interface
downdown ifconfig eth0 downBring
interface upup (add IP
address)ifconfig eth0 up (ifconfig
eth0 10.10.10.10)