Solved

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

Posted on 2011-03-15
3
655 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

929 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

15 Experts available now in Live!

Get 1:1 Help Now