[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

IP-address change...

Here's the situation :
I've got a linuxbox connected to my ISP (cable modem) using dhcp to get my ip-address. The box is used as a firewall and an ip-masq box for the rest of the network. This setup worked fine for about 3 weeks, until yesterday. My ISP changed the ip-address given to linux, but linux didn't see?, accept? reject? the change.

rebooting the system solved the problem. But why isn't this new ip-address accepted automatically?? How can I make sure I don't have to reboot my linuxbox next time my ISP changes the ip-addresses?

Comments only please. I will reject all answers. (And rejected answers don't have a "accept comment as answer" button)
0
940961sl
Asked:
940961sl
  • 6
  • 6
  • 2
1 Solution
 
j2Commented:
Not enough detail.

Which distro?
Which DHCPCd?

(If the answers are "Redhat" and "pump" there's your problem right there).

Anyway, you really should use a client such as ISC's dhclient, or (which i run) dhcpxd. http://www.guido.yi.org:50080/

It has all the nessesary features, and some cool ones.  However, you will also have to figure out a way tó restart all services who needs restarting if the ip changes. dhcpxd contains some hooks for that.

And rebooting was drastical. just bringing the interface down, and then back up would have fixed it.
0
 
AGBCommented:
If you are just a regular user you need a DCHP client daemon. The package you need to download and to install is called dhcpcd.

In RedHat start Control Panel by typing control-panel.
Select Network Configuration;
Click on Interfaces;
Click Add;
Select Ethernet;
In the Edit Ethernet/Bus Interface select "Activate interface at boot time" as well as select DHCP as Interface configuration protocol.
When you are finished go the "last step"
0
 
940961slAuthor Commented:
Thanks for the responce.
The distribution is RedHat 6.0
I don't know anything about the client deamon... I just installed the networkcards, configured them and it worked fine. I didn't install any dhcp client.
I will check out the link above and see if I can get it to work.

What services need to restart if the ip changes?? I've got a telnet and an ftp server.

I'll be back in a couple of days...
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
940961slAuthor Commented:
AGB :
Thats what I did in the first place to configure the network. So doing it again wont change very much I'm afraid...

j2 :
I donwloaded dhcpxd and compiled it using the commands :

../configure
make
make install

and i restarted the system. a ps -aux doesn't show me anything like dhcpxd. but I did see a /sbin/pump -i eth running so I guess the old dhcp client is still installed and running? How do I continue from here, and as important, how do I test everything when it's installed? Do I have to wait another 3 weeks until my ISP changes ip-addresses again?
0
 
940961slAuthor Commented:
Sorry, ../configure should be ./configure. Just 1 .
0
 
AGBCommented:
dchpcd but not dchpxd
0
 
j2Commented:
You also need to edit /sbin/ifup and /sbin/ifdown

replace

if /sbin/pump $PUMPARGS -i $DEVICE ; then

with

if /sbin/dhcpxd -w -c -n $DEVICE ; then

in ifup.

and replace

pump -r -i ${DEVICE}

with

dhcpxd --kill ${DEVICE}

in ifdown
0
 
j2Commented:
dhcpxd has everything dhcpcd has, and more. dhcpxd even gives _useful_ logs when something fails. Which is more then i can say for dhcpcd.

also, unless you want dhcpxd to log to a console (tty7 by default) do this

rm /etc/dhcpxd/out ; touch /etc/dhcpxd/out

this will log to file instead.
0
 
j2Commented:
But, you could also just run

ifdown eth0
/sbin/dhcpxd -w -c -n eth0

to see all activities. If it still can not bring the interface up, the output here will most likely be helpful in troubleshooting.


(note, you will still have to edit ifup and ifdown for the system to work right in the end. the above is for troubleshooting)
0
 
940961slAuthor Commented:
Thanks j2, It looks like everything is working fine. I didn't check the commands in your last comment, because I'm doing everything from a remote computer with a telnet client. So bringing down the ethernet card would not be a good idee. That's why I reboot all the time :-).

I'll guess I'll have to believe you If you say that this will solve my problem with the changing ip-addresses.

Just 1 last question : How do I restart my telnet and ftp server whenever i get a new ip-address, or is this not neccessary??
0
 
j2Commented:
Once you have modified the ifup and ifdown that will be automatic. ASSUMING that the daemons are "aware" of how to listen for such events nicely. I've never had any problem with apache / sshd / proftpd / etc / etc.

actually, if you do a

ifdown eth0 ; ifup eth0

it should work, as the _whole_ string is sent before the first command executes, ive done that remotely and its never failed. Tho, i wouldnt try it until i have seen that it _really_ works to bring the system back up again :)

Another thing you could do (i always do this) is to logon to a screened tty (screen is not installed by default) as this allows you to reconnect to a tty process and continue where you left off.
0
 
940961slAuthor Commented:
Thanks a lot. I hope this will help :-)

BTW. I didn't understand the last comment on the tty kind of thing... but then... I don't understand tty at all. What is it all about?
0
 
j2Commented:
Ok, when you log off you kill all your processes, right? (same thing happens when you kill the eth interface, right?)

screen "keeps all your processes running"... Uhm, like this

1. Log on
2. start 'screen'
[now everything is run trough screen]
3. launch an ftp program
4. disconnect
5. Log back on later
6. screen -r
7. Voila, there is your ftp process still running.

And of cource you can create "new" screens (CTRL-a c) and then switch between them (CTRL-a p & CTRL-a n) and do all sorts of great things.

I use this to "move" all my processes around, since i just disconnect / reconnect to my screen when i am at home / work / firends place. And its especially great if you have a bad line, just because the modem / router goes down, you dont loose what you were doing.

Screen isnt installed by default, but it is available in .rpm format on your CD.
0
 
940961slAuthor Commented:
Thanks for the tip j2. Your a great expert.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 6
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now