LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   I want static IP, but have to use DHCP (preffered/desired address) (https://www.linuxquestions.org/questions/linux-networking-3/i-want-static-ip-but-have-to-use-dhcp-preffered-desired-address-288370/)

homa2001 02-09-2005 10:39 PM

I want static IP, but have to use DHCP (preffered/desired address)
 
The question is simple!
My provider (Charter Communications) is using cable modems and runs DHCP obviously. While ago I have been granted access to a forum by my IP address, because it was always the same (my computer ran 24/7). Then I put linux on it and of course got new IP, so I don't have access to that forum any more:( .
Does some body know where in linux desired/last/preferred address stored, so I would edit it, and try to get it of DHCP after reboot?
Or may be as a solution some kind of DHCP packet spooffer, so I can put static IP and spoof DHCP requests and responses


Any help deeply appreciated
:study: :newbie: :scratch:

secesh 02-09-2005 10:50 PM

let me save you some trouble... you won't get a static ip from your cable provider without paying for it.

whatever forum grants access via IP is not catering to the general public, and has a downright ignorant access verification system.

ISPs tend to offer static IP addresses with an increased service fee.


(it wasn't linux's fault your IP rolled... it was meerly a matter of time)

homa2001 02-09-2005 11:01 PM

No, no, I am not saying that it was a linux fault. I know how DHCP works, so I guessed, that I can try to get my IP via DHCP in this way. In windows, if you set your NIC to static IP and then enable it back to DHCP, it will first try to get that static IP via DHCP. In linux I just don't know how exactly to do this

gd2shoe 02-09-2005 11:27 PM

ifconfig eth0 55.68.16.46

For example. This will tell linux to temporarily use this ip address.
I don't expect your ISP will honor it though.

(eth0 is normally the first ethernet connection. You can get more info by running ifconfig with no arguments. Ignore 'lo', it is the loopback device.)

homa2001 02-09-2005 11:39 PM

Yes, I tryed that one, setted it to static IP first, and then back to DHCP, and I still get the previous IP that I got via DHCP before. Well, I understand, that it might be assigned already, and that I cannot ping it means nothing.
There is a file in my /etc/sysconfig/network called eth-00:04......and so on my MAC, and in this file I have

BOOTPROTO=dhcp
_nm_name=bus-pci-0000:00:09.0
REMOTE_IPADDR=""
MTU=""
NETMASK=255.255.254.0
UNIQUE=WL76.IH1TcNNtXe0
BROADCAST=24.XXX.XXX.255
IPADDR=""
STARTMODE=onboot
NETWORK=""
USERCONTROL=no

What does IPADDR used for?
Is this file dynamically created each time?

secesh 02-09-2005 11:43 PM

http://howtos.linux.com/guides/solrh...ap9sec90.shtml

generally used whith bootproto=static, i can't say what effect (if any) it might have on dhcp... couldn't pull a reference on that within <2mins either...

homa2001 02-09-2005 11:56 PM

I don't have these particular files in my /etc/sysconfig/network/scripts
I have ifup-ppp, ifup-autoip and so on, but in /etc/sysconfig/network I have the above mentioned file, that probaly serves the same purpose, so I'll try to put my desired address in that IPADDR field...:Pengy: :scratch:

vimal 02-09-2005 11:57 PM

hi,
open /etc/sysconfig/network-scripts/ifcfg-eth0 and add the following
BOOTPROTO=static
IPADDR= ur ip
save the file and restart network service.
the command 'ifcfg eth0 x.x.x.x ' wont work. u will get ur static ip. or execute 'netconfig', enter ur ip,netmask,gateway...etc and exit.restart network service. happy networking

homa2001 02-09-2005 11:59 PM

Yeah, It work for me like that for a while, but then, I think the lease just expired and I lost connectivity, so I had to use DHCP. Like it was said before, ISP will probably not honor that

homa2001 02-10-2005 12:24 AM

I tryed the following

1. edited the file ifcfg-eth-00:04..... that responds to my "outlooking" connection and left everything the same as in above quote, but put IPADDR=24.XXX.XXX.XXX (my desired IP)

2. #ifconfig eth1 down
3. #ifconfig eth1 up
4. #ifconfig eth1
showed that I still have my previous IP, but I totally lost connectivity ot the Internet
so I edited evetything back and restarted the interface, still no connectivity until I restarted the machine:(

It looks like I do not understand something, but I want back to that forum :cry:

gd2shoe 02-10-2005 12:46 AM

How did you get into the forum in the first place?
Was it free, or did you need to pay for it?

If it was free, then why not just register again?

If it wasn't free, then they probably don't track usage by IP address.
If they do, then I wouldn't use that forum!

homa2001 02-10-2005 12:56 AM

It is free, but they filter by IP, I guess, so foreiners cannot post, but can read though. I am from the city, that that forum belongs to, but moved to a different country, so I don't have access anymore. I wrote to the admin of that forum with requetst to open access for me, and he did, but he does not respond to my request now :( , and probably will not. So the only way to get access again is to get back that particular IP or use one of their proxies, but I don't want to do so. But the forum is not the concern right now. Right now it is like a challenge for me to get that IP. And to gain more experience with linux at the same time. Forum is just a pleasant addition to that, cause I still can post there from school as they hava a static IP, and he granted access from there as well

gd2shoe 02-10-2005 01:38 AM

Interesting... Ok. :)

Wish I could help more. I'm not sure much more can be done.

One thing to watch out for though. Your ISP definitely will not assign you that address if someone else is using it. Before you make your next attempts, you may want to ping/traceroute the address to see if you can tell if it is currently assigned (A returned ping means "No". Lack of a ping return means nothing.)

homa2001 02-10-2005 01:47 AM

I tryed that, and I recieved destination ureachble, but its MAC is in my ARP table (we are on the same subnet), so that means, that somebody is having it :cry:
, but they will release it some day, so any guesses how can you ask DHCP for a specific address first?


All times are GMT -5. The time now is 04:08 AM.