Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
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 connection

You 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 Example

Create  alias [network  device] ifconfig    eth0:0_:[number]

10.10.10.10

Change  IP
address

ifconfig    eth0    10.10.10.12

Change  the
netmask

netmask [netmask] ifconfig  eth0    netmask
255.255.255.0

Change  the
broadcast

broadcast [address]ifconfig eth0    broadcast
10.10.10.255

Take
interface
down

down ifconfig   eth0    down

Bring
interface up

up  (add    IP
address)

ifconfig    eth0    up  (ifconfig
eth0 10.10.10.10)
Free download pdf