Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to manually configure eth0 in Ubuntu? I don't have any DHCP server. Do I need IP address when I am just going to capture packets?

share|improve this question

migrated from Mar 19 '11 at 9:02

This question came from our site for system and network administrators.

Will you be doing it with programming? – Ignacio Vazquez-Abrams Mar 19 '11 at 6:33

I am not sure what you exactly mean by your question. The really manual method has been described above, but since you write you don't have DHCP, I think you rather would like to know what to do to give your box a static IP address and assign this IP address at boot time automatically. Well, here is how:

There should be a file /etc/network/interfaces. This file is read by the Ubuntu boot scripts which in turn configure the network according to that file. If you would like to know what should / could go into that file, then please type "man interfaces".

For example, my /etc/network/interfaces looks like this (comments are cut out):

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

The first two lines are standard and may already look similar on your box. You may be interested especially in the rest of the file: These lines define a static network configuration to eth0 (without DHCP), and this static configuration gets active automatically on every boot.

share|improve this answer

You don't need IP address for capturing packets in promiscuous mode (when you want to capture all traffic, not just traffic destined to your computer). You can put that interface up using command

ifconfig eth0 up

This do not assign IPv4 address to interface (IPv6 local-link address is automatically assigned, if you have IPv6 enabled).

share|improve this answer

You may want to try this as well:

  1. sudo -H gedit /etc/network/interfaces

  2. Edit the eth0

    auto eth0
    iface eth0 inet dhcp
  3. Save and Exit

  4. Run sudo /etc/init.d/networking restart.

share|improve this answer
ifconfig etho
ifconfig ehto netmask
route -n


ip route show
name for DNS
nameserver 127.0.11
share|improve this answer
the abover answer just configuration for ip address – Ahmad safi Afghanistan Oct 12 '15 at 11:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.