• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

Configure ethernet to get IP address from DHCP in Ubuntu and Debian

January 12, 2014 by Sharad Chhetri Leave a Comment

In this tutorial we will learn about how to configure ethernet to get IP address from DHCP Server in Ubuntu and Debian. Configuring the ethernet for getting ip address from DHCP server hardly takes 3-4 Steps.
The tutorial is applicable if you add new ethernet also. Here in this tutorial we have added one more Ethernet or Network Card in the system.

Follow the steps to configure the Ethernet in Ubuntu and Debian

Step 1: After login into the system.First check which Ethernet has not been assigned ip address either manually or via DHCP server.

sudo /sbin/ifconfig

As per the given below screenshot eth1 does not have any ip address,here we are configuring the eth1 to get IP Address from DHCP server

ubuntu network

Step 2: Now edit the /etc/network/interfaces file and add the below given lines for ethernet you want to configure.Below given is a syntax.And next is reference for eth1

Note: Replace ethernet-name with available ethernet in your system. For eg. eth0 ,eth1 etc

auto ethernet-name
iface ethernet-name inet dhcp

sudo vi /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp

Step 3: Now up the ethernet which was already down or you can restart the networking service also

Syntax:
ifdown ethernet-name (To down the ethernet)
ifup ethernet-name (To up the ethernet)

Example

sudo ifdown eth1
sudo ifup eth1

Alternatively, you can restart the networking service also

sudo service networking restart

OR 

sudo /etc/init.d/networking restart

Step 4: Now check the ip address with ifconfig command

sudo /sbin/ifconfig

or 

ifconfig

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. How to set DHCP offered ip address to particular ethernet in freebsd
  2. linux release renew dhcp assigned ip address
  3. How to configure ethernet in CentOS 6 after installing in Virtual Box
  4. How to configure static ip address through command line in Ubuntu
  5. How to install and configure DHCP server on RHEL 5
  6. Enable ethernet in RHEL 6.0 and CentOS 6.0 : Tested In Virtual Box and VMware
  7. Prevent starting service after package installation on Ubuntu / Debian
  8. Completely remove package on Ubuntu / Debian by apt-get
  9. How to configure multiple mysql instance in Ubuntu
  10. Show visitor ip address php code

Filed Under: Linux Tagged With: debian, dhcp, ubuntu

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

Terminal Recording with script and scriptreplay command

Edit the crontab without using crontab -e

Protect from w00tw00t.at.blackhats.romanian.anti-sec

How to forcefully send mail from mailq in sendmail MTA

4 Different commands to find system uptime in linux

How to create a file with cat command

linux release renew dhcp assigned ip address

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy