change ip adress from static to dhcp and opposite

Asked by luuminh

I have LAN and I have ADSL, when I on LAN the I change IP into IP static and when I use ADSL I change IP into DHCP, it's easy for me, but some one who dont't know how to set the IP adress from static into DHCP and opposite, how do I do, guide me please

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-nettool Edit question
Assignee:
No assignee Edit question
Solved by:
marcobra (Marco Braida)
Solved:
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

Please tell do you want made it with a shell script... ?

Revision history for this message
luuminh (taolao-q) said :
#2

yes, I do. because there are about 5 people use the pc and they don't know how
to change the IP, so I want to a shell script for all people.

________________________________
Từ: marcobra (Marco Braida) <email address hidden>
Đến: <email address hidden>
Gửi ngày: 19:43:54, Thứ Hai, 13 tháng 9 2010
Chủ đề: Re: [Question #125213]: change ip adress from static to dhcp and
opposite

Your question #125213 on gnome-nettool in ubuntu changed:
https://answers.launchpad.net/ubuntu/+source/gnome-nettool/+question/125213

    Status: Open => Needs information

marcobra (Marco Braida) requested for more information:
Please tell do you want made it with a shell script... ?

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/ubuntu/+source/gnome-nettool/+question/125213

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

You need to change the content of

/etc/network/interfaces

http://www.ubuntugeek.com/ubuntu-networking-configuration-using-command-line.html

using a bash script https://help.ubuntu.com/community/Beginners/BashScripting

Then try to call the script from /etc/rc.local startup file

You might also want to disable the startup of network-manager service

Revision history for this message
Best marcobra (Marco Braida) (marcobra) said :
#4

The simplest solution is to made two files into a directory:

netstatic and netdhcp put the settings you want into the netstatic and into netdhcp file and then copy the desired file overwriting the /etc/network/interfaces file and from same script restart the network

Revision history for this message
luuminh (taolao-q) said :
#5

it's done, thanks a lot