Setup Ubuntu static ip address with ifconfig command. Here is a part of ifconfig information from the manual page:
NAME
ifconfig - configure a network interface
SYNOPSIS
ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...
DESCRIPTION
Ifconfig is used to configure the kernel-resident network interfaces.
It is used at boot time to set up interfaces as necessary. After that,it
is usually only needed when debugging or when system tuning is
needed.
The ifconfig command is used to manipulate ip address in Ubuntu. We can setup a new ip address for a network card or change ip address and netmask of existing card. From the synopsis above, we can simply use ifconfig command format as:
Here are some ifconfig command examples for you:
Example 01 - Using ifconfig command with no option.
luzar@ubuntu:~$ ifconfig |
Example 02 - Using ifconfig command to setup ip address for a second Ethernet card in Ubuntu system.
luzar@ubuntu:~$ ifconfig eth1 192.168.44.128 netmask 255.255.255.0
broadcast 192.168.44.255 up
The ifconfig command above should be in one line.
Example 03 - Using ifconfig command to change ip address for existing Ethernet card in Ubuntu system.
luzar@ubuntu:~$ ifconfig eth0 192.168.1.3
luzar@ubuntu:~$ ifconfig eth0 netmask 255.255.255.0
Restart network service:
Hii,
ReplyDeleteI'm new to linux.
on executing following command on shell -
ifconfig eth1 192.168.44.128 netmask 255.255.255.0
broadcast 192.168.44.255 up
i'm getting reply as
permission denied
even i've priorly used su command to be super user. Please help me to sort out my this problem.
Thanks!!!
append this command with sudo
Delete