You are on page 1of 22

Ubuntu Networking Conguration Using Comma...

Contact

Forum

Ubuntu Hosting

Free Ubuntu E-Books


About

RSS Feed

http://www.ubuntugeek.com/ubuntu-networking-c...

Popular Posts
Sitemap

Search

Privacy Policy

Ubuntu Geek
Ubuntu Linux Tutorials,Howtos,Tips & News | Xenial Xerus,Yakkety Yak

Sponsored Link

Categories
Backup
Free Books
General
Monitoring
Networking
News
Package Mgmt
Security
Server
Sponsored Link
Archives
Select Month

Ubuntu
Networking
Configuratio
n Using
Command
Line

RSS Feed

UbuntuGeek on Twitter

Posted on February 5,
2007 by ruchi
138 Comments

Sponsored Link

Support UbuntuGeek

The basics for any


network based on
*nix hosts is the
Transport Control

Favourite Sites

Protocol/ Internet
Protocol (TCP/IP)
combination of three

Tuxmachines

Debian Admin
DebianHelp

protocols. This
combination consists
of the Internet
Protocol
(IP),Transport
Control Protocol
(TCP), and
Universal Datagram
Protocol (UDP).
By Default most of

1 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

Contact

Forum

http://www.ubuntugeek.com/ubuntu-networking-c...

the users
configure
Free Ubuntu
E-Books
Popular Posts
their network card
Feed

during the

Sitemap

Search

Ubuntu Hosting

About

RSS

Privacy Policy

Copyright 2016 Ubuntugeek - Ubuntu Linux Howtos and Tutorials All Rights Reserved.

installation of
Ubuntu. You can

however, use the


ifconfig command at
the shell prompt or
Ubuntu's graphical
network
configuration tools,
such as networkadmin, to edit your
system's network
device information or
to add or remove
network devices on
your system
Configure Network
Interface Using
Command-Line
You can configure a
network interface
from the command
line using the
networking utilities.
You configure your
network client hosts
with the command
line by using
commands to
change your current
settings or by editing
a number of system
files.
Configuring DHCP

2 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

address for your


network card
If you want to
configure DHCP
address you need to
edit the /etc/network
/interfaces and you
need to enter the
following lines
replace eth0 with
your network
interface card
sudo vi
/etc/net
work
/interfa
ces
Note :- Use vi editor
if you don't have
GUI installed
If you have GUI use
the following
command
gksudo
gedit
/etc/net
work
/interfa
ces
# The
primary
networ
k
interfac

3 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

e -use
DHCP
to find
our
addres
s
auto
eth0
iface
eth0
inet
dhcp
Configuring Static IP
address for your
network card
If you want to
configure Static IP
address you need to
edit the /etc/network
/interfaces and you
need to enter the
following lines
replace eth0 with
your network
interface card
sudo vi
/etc/net
work
/interfa
ces
Note :- Use vi editor
if you don't have
GUI installed
If you have GUI use

4 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

the following
command
gksudo
gedit
/etc/net
work
/interfa
ces
# The
primary
networ
k
interfac
e
auto
eth0
iface
eth0
inet
static
addres
s
192.16
8.3.90
gatewa
y
192.16
8.3.1
netmas
k
255.25
5.255.0
networ
k
192.16
8.3.0

5 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

broadc
ast
192.16
8.3.255
After entering all the
details you need to
restart networking
services using the
following command
sudo
/etc/init
.d
/networ
king
restart
Setting up Second
IP address or Virtual
IP address in
Ubuntu
If you are a server
system administrator
or normal user some
time you need to
assign a second
ipaddress to your
Ubuntu machine.For
this you need to edit
the /etc/network
/interfaces file and
you need to add the
following
syntax.Below one is
the only example
you need to chnage
according to your ip
address settings
6 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

sudo vi
/etc/net
work
/interfa
ces
Note :- Use vi editor
if you don't have
GUI installed
If you have GUI use
the following
command
gksudo
gedit
/etc/net
work
/interfa
ces
auto
eth0:1
iface
eth0:1
inet
static
addres
s
192.16
8.1.60
netmas
k
255.25
5.255.0
networ
k
x.x.x.x
broadc
ast
7 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

x.x.x.x
gatewa
y
x.x.x.x
You need to enter all
the details like
address,netmask,net
work,broadcast and
gateways values
after entering all the
values save this file
and you need to
restart networking
services in debian
using the following
command to take
effect of our new
ipaddress.
After entering all the
details you need to
restart networking
services using the
following command
sudo
/etc/init
.d
/networ
king
restart
Setting your ubuntu
stytem hostname
Setting up your
hostname upon a
ubuntu installation is
very straightforward.

8 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

You can directly


query, or set, the
hostname with the
hostname
command.
As an user you can
see your current
hostname with
sudo
/bin/ho
stname
Example
To set the hostname
directly you can
become root and run
sudo
/bin/ho
stname
newna
me
When your system
boots it will
automatically read
the hostname from
the file
/etc/hostname
If you want to know
more about how to
setup host name
check here
Setting up DNS
When it comes to
DNS setup Ubuntu
9 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

doesn't differ from


other distributions.
You can add
hostname and IP
addresses to the file
/etc/hosts for static
lookups.
To cause your
machine to consult
with a particular
server for name
lookups you simply
add their addresses
to /etc/resolv.conf.
For example a
machine which
should perform
lookups from the
DNS server at IP
address 192.168.3.2
would have a
resolv.conf file
looking like this
sudo vi
/etc/res
olv.con
f
Note :- Use vi editor
if you don't have
GUI installed
If you have GUI use
the following
command
gksudo

10 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

gedit
/etc/res
olv.con
f
enter the following
details
search
test.co
m
names
erver
192.16
8.3.2
Sponsored Link
Tweet
Share
Share
Mail
Share
Share
Share

Related posts
Update IP
addresses at
dynamic DNS
services
Using ddclient
(17)
slurm
Realtime
network
interface

11 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

monitor (2)
Securing SSH
Using
Denyhosts
(10)
Mount
Network File
systems
(NFS,Samba)
in Ubuntu
(13)
Howto Install
Freecom
Musicpal in
Ubuntu Feisty
(3)
How to Setup
Transparent
Squid Proxy
Server in
Ubuntu (41)
How to Install
PPTP GUI
(To connect
windows
VPN) in
Ubuntu (10)

138 thoughts on
Ubuntu
Networking
Configuration
Using Command
Line
Older
Comments

12 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

ramakrishna on
January 10, 2012 at
9:27 am said:
mr amit first u can
disable firewall and
also disable ipv6
then after u can
access internet
Deepak on January
12, 2012 at 3:13 pm
said:
After restart all IP
setting are flushing.
Pls help me..
markpupugee on
February 4, 2012 at
3:10 am said:
how to configure
dual lan in UBUNTU
??
joies on March 4,
2012 at 8:37 am
said:
What is the
broadcast address
for?
dawe on March 5,
2012 at 5:48 pm
said:
it is an address,

13 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

which covers all


addresses in the
subnetwork, I think

Krahazik on May 7,
2012 at 7:46 pm
said:
Ok this is all well
and good but
completely useless
for my problem as
/etc/resolv.config is a
TEMPORARY file
and gets overwritten
each time the
computer is
rebooted. Having to
edit that file every
timeI boot the
machine up is
getting old fast. So
where do I go to
permanently add the
infor that I keep
adding to
/etc/resolve.config
using command
line?
mikecrosoft on May
22, 2012 at 10:44
pm said:
Change the file
access permissions
to only read for your

14 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

user.

Krahazik on May 23,


2012 at 3:46 pm
said:
And how does that
answer my
question?
Norbert on June 17,
2012 at 12:09 pm
said:
Use /etc/resolv.conf
instead of
/etc/resolv.config
tonymac on June 25,
2012 at 4:00 pm
said:
Ubuntu uses a
resolver setup called
resolvconf which I
find difficult to follow.
You could start with
man :
me@home:~$man
resolvconf.
Online at ubuntu
there is a set of man
pages too, for
example if you use
karmic then:

15 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

http://manpages.ubu
ntu.com/manpages
/karmic
/man8/resolvconf.8.h
tml
I wish you luck in
trying to figure it out
!
tonymac on June 25,
2012 at 4:19 pm
said:
I have read the man
again. It seems to
me that there are
only two scenarios:
IP address obtained
from DHCP server,
or IP statically set.
For IP address
obtained from DHCP
server you must set
the DNS server
entries in the DHCP
server e.g. your
internet router.
DHCP will pass this
to your desktop pc,
which will tell
resolvconf to update
its information.
/etc/resolv.conf is
just a link to the
resolvconf
configuration : there
is no need to touch
it. Now you have

16 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

your DNS set up, the


same as your router.
Scenario 2: you are
behind a router but
have a static IP
address. In this case
you must include a
line in /etc/network
/interface to set the
DNS server
information. Your
networking software
will push this to
resolvconf which will
update the DNS
record to use your
choice of DNS
server. Here is an
example of an entry
in /etc/network
/interfaces:
## The primary
network interface
use fixed IP settings
#
# auto eth0
# iface eth0 inet
static
# address
192.168.3.90
# gateway
192.168.3.1
# netmask
255.255.255.0
# network
192.168.3.0
# broadcast
192.168.3.255

17 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

## This dns entry


will push information
to resolvconf.
## /etc/resolv.conf
gets the info as it is
## a link to the
resolvconf setup file.
# dns-nameservers
11.22.33.44
55.66.77.88
# After any changes,
restart networking
using
# sudo /etc/init.d
/networking restart
Change the entry to
suit your setup.
Finally note you
must restart
networking as last
line in example.
I am not a guru so
read first e.g. use
google and search
for ubuntu
resolvconf
tonymac on June 25,
2012 at 4:26 pm
said:
The above example
just adds the
dns-nameservers
line to the example
given earlier in this
article, sorry I meant

18 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

to credit this in my
previous post.

Randy L on
September 13, 2012
at 9:08 pm said:
Thanks for the post.
For some reason my
network was
configured to the
loopback device. My
ssh logins and other
network connection
are much faster now.
roc on November
10, 2012 at 7:38 am
said:
Hi,
I cant able to ping
google.com I had
given DNS but it is
not working. Help
me
Bill Ross on
February 13, 2013 at
11:14 pm said:
How do I change my
/etc/network/network
file to read-write? Im
not able to change it.

19 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

Thanks.
Im a newbe.

Ron on February 24,


2013 at 3:58 pm
said:
I am running Ubuntu
12.10
How would I just
view the settings for
my network. I can
bet it is a cat
command but not
exactly sure
where/how to find it
on the command
line. I would
normally just do an
ipconfig in windows.
Any help would be
grateful
Thanks

20 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

Adam on May 1,
2013 at 3:35 pm
said:
ifconfig is probably
what youre looking
for. Read the man
page if you need
more specifics than
what it gives you by
default.
Bruce on July 24,
2013 at 5:17 pm
said:
Bill, not sure if you
figured it out, but
you should be able
to do the following
command:
sudo chmod 644
/etc/network/network
HTH

Older
Comments

Leave a
comment
Your email address
will not be published.
Required fields are
marked *
Comment

21 of 22

Sunday 30 October 2016 03:44 PM

Ubuntu Networking Conguration Using Comma...

http://www.ubuntugeek.com/ubuntu-networking-c...

Name *

Email *

Website

Post Comment

Ubuntu
Networking
Configuration
Using Graphical
Tool
Ubuntu Network
Troubleshooting
Tips

22 of 22

Sunday 30 October 2016 03:44 PM

You might also like