Solved

How to save a modifed IP permanently in linux system by using ifconfig?

Posted on 2011-03-15
3
653 Views
Last Modified: 2012-08-14
Dear,

I have debian server with a default DHCP. I change the IP of the system by using ifconfig as below:

/ifdown eth0
 
/ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up

It is getting the new static IP, but when reboot it will get back as dhcp and a new IP is assigned such as 192.168.1.100

I need to save the new IP in the system and stop the dhcp. how?

Nabil
0
Comment
Question by:nabilhammoud
3 Comments
 
LVL 15

Accepted Solution

by:
Insoftservice earned 175 total points
ID: 35136071
hi,

vi /etc/sysconfig/network-script/ifcfg-eth0

change bootproto from dhcp to static.
assign the ip to it.
u can do the same thing via
cmd =>  neat

0
 
LVL 16

Assisted Solution

by:Blaz
Blaz earned 75 total points
ID: 35147124
To further clarify insoftservice's suggestion the file /etc/sysconfig/network-script/ifcfg-eth0 should look like

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=192.168.1.2
USERCTL=no
PEERDNS=yes
TYPE=Ethernet
IPV6INIT=no
0
 

Author Closing Comment

by:nabilhammoud
ID: 35154387
THX
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now