Solved

IP-address change...

Posted on 2000-03-09
14
369 Views
Last Modified: 2010-03-18
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
Comment
Question by:940961sl
  • 6
  • 6
  • 2
14 Comments
 
LVL 12

Accepted Solution

by:
j2 earned 100 total points
ID: 2600485
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
 

Expert Comment

by:AGB
ID: 2605329
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
 
LVL 1

Author Comment

by:940961sl
ID: 2607964
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 1

Author Comment

by:940961sl
ID: 2611376
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
 
LVL 1

Author Comment

by:940961sl
ID: 2611381
Sorry, ../configure should be ./configure. Just 1 .
0
 

Expert Comment

by:AGB
ID: 2611438
dchpcd but not dchpxd
0
 
LVL 12

Expert Comment

by:j2
ID: 2611440
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
 
LVL 12

Expert Comment

by:j2
ID: 2611451
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
 
LVL 12

Expert Comment

by:j2
ID: 2611464
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
 
LVL 1

Author Comment

by:940961sl
ID: 2611555
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
 
LVL 12

Expert Comment

by:j2
ID: 2611578
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
 
LVL 1

Author Comment

by:940961sl
ID: 2611614
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
 
LVL 12

Expert Comment

by:j2
ID: 2611629
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
 
LVL 1

Author Comment

by:940961sl
ID: 2611637
Thanks for the tip j2. Your a great expert.
0

Featured Post

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Webmin Bandwidth Monitoring not working 10 165
linux 2 108
Linux : when to add the entries in /etc/hosts file 22 104
IPA - change main server? 3 174
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

713 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