VectorLinux
July 30, 2014, 04:57:20 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: Changing IP on the fly?  (Read 949 times)
Windozer
Vectorite
***
Posts: 386


Have Vector Linux, Will Travel.


« on: January 18, 2009, 09:20:21 am »

OK, I'm stumped... this has to be easy...

1. Need to change at will from a DHCP assigned IP address to a fixed IP - and vice versa (Without having to reboot and without using VASM, if possible.)

Can I do this from a CLI?

Is it some flavor of ifconfig or eth(n) ?

2. Similarly, this machine is powered up at the same time as its DSL modem/switch/DHCP server. The machine screams so fast with VL  Cool that it will actually boot to GUI level before the DSL modem has synced and made an IP address available... that leads to the problem of having no IP address!
Tried eth0 down.. eth0 up but that had some side effects that I don't understand yet.

And, as always, your help is much appreciated!

cheers,
- Howard in FL
~~~~~~~~~
Logged

483,617th Registered Linux Snoozer
bigpaws
Vectorian
****
Posts: 1844


« Reply #1 on: January 18, 2009, 11:16:15 am »

It depends on what you want.

If it is just that the DSL modem is slow then you can
simply wait to start the machine. You can also just assign an ip fulltime.

Using netconfig vs VASM is not much different in speed.

You can write a bash script to handle it all as well since it appears you know what you want
something like this:

ifconfig down
dhcpcd -k &&
ifconfig eth0 up &&
dhcpcd eth0

Then make the file executable chmod +x filename

Then just call it as root ./filename

To assign the address would be another bash script:

ifconfig eth0 down
dhcpcd -k
ifconfig eth0 192.168.1.1 netmask 255.255.255.0
route add default gw 192.168.1.2 (NOTE: this is the DSL modem address)

Then make it executeable chmod +x filename

Then when you want a statis ip you can do this ./filename

HTH

Bigpaws

Logged
Windozer
Vectorite
***
Posts: 386


Have Vector Linux, Will Travel.


« Reply #2 on: January 18, 2009, 04:34:05 pm »

Thanks Bigpaws

is there a way to get ipconfig to /release the DHCP and then have it (re)assign (/renew) a new one?

I know how to do this in windows, but...
« Last Edit: January 18, 2009, 05:07:15 pm by WinDoze » Logged

483,617th Registered Linux Snoozer
bigpaws
Vectorian
****
Posts: 1844


« Reply #3 on: January 18, 2009, 06:21:19 pm »

dhcpcd -k

That kills dhcp and then dhcpcd eth0 call a
dhcp server for an ip.

Bigpaws
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!