LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Renewing DHCP Lease (https://www.linuxquestions.org/questions/linux-networking-3/renewing-dhcp-lease-10219/)

JimKyle 12-17-2001 11:07 AM

Renewing DHCP Lease
 
I'm running Mandrake 8.1 as a firewall/router for my LAN which has 4 Win98 boxes. I'm connected to the Internet via DSL on the Linux box (as eth1) and get my external IP address via DHCP from my ISP. Twice in the past three weeks I've apparently failed to renew the lease on the address, and lost connectivity. Both times, rebooting the Linux box brought everything back -- but that seems to be a Win9x solution rather than a *nix way to do things. Can someone tell me the sequence of commands needed to force renewal without taking the system down to do so?

I'd also like to know how to make portsentry work; it appears that my firewall (iptables) is preventing any scan attempts from getting to portsentry. My logs show a dozen or more attempts to get into port 111 each day (I maintain an open FTP server, which is a beacon for the script kiddies), but portsentry doesn't have anything in its files to reflect that...

ryandelany 12-18-2001 01:01 AM

Don't know about Mandrake specifically, but you can try reading up on the pump command with man pump

Also try just restarting the network services. In RedHat you can use service network restart , if that doesn't work try /etc/rc.d/init.d/network restart

You should almost never have to reboot in *nix, that is a nasty Windows habit you need to get away from!

Ryan

JimKyle 12-18-2001 08:22 AM

No trace of a "pump" command but I suspect that "service network restart" should do the trick. Will try that next time it happens.

Agreed that rebooting isn't a Good Thing. That's one of the major reasons I switched over for the firewall/router box (which is doubling as a file server but using a different drive). The other was to have better control of my system...

DavidPhillips 12-18-2001 12:02 PM

this does not sound like dhcp

it sounds like you are loosing connection on the dsl which should reconnect automatically if you are using rp-pppoe

put DEMAND=no

in /etc/ppp/pppoe.conf

JimKyle 12-18-2001 01:05 PM

As best I've been able to determine, swbell.net isn't using PPPoE. It acts more like a simple WAN; while I'm paying only for a dynamic IP, for the first 11 months I had the service it never changed. Then the network went down for several days and when it came back up I had a new IP, which has remained constant for almost 5 months now. The "DSL modem" is a SpeedStream 5260 with four LEDs on the front of it. When the service won't let me connect to anything outside, all four of them are still showing green; I would expect the DSL light to be off, if the DSL connection was actually gone.

Last time it happened I checked "route" to make certain I still had the gateway configured; all looked good but I wasn't able to ping the gateway using its IP address until after the reboot -- and then everything worked again.

Next time I'll try "service network restart" and see if that does the trick. I suspect it's something a bit flaky in the way swbell.net handles its DSL circuits in this area, possibly causing the other end to stop listening to me...

Sylhouette 12-19-2001 04:48 AM

YYou can also use command ifdown eth0 and then ifup eth0

It stops and starts the interface eth0 without laying down all networking within your pc

DavidPhillips 12-19-2001 01:49 PM

what do you get when you run ifconfig

JimKyle 12-19-2001 02:02 PM

Here's what ifconfig shows:

eth0 Link encap:Ethernet HWaddr 00:80:C6:F2:E2:67
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1306457 errors:0 dropped:0 overruns:0 frame:0
TX packets:1089386 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1465897549 (1397.9 Mb) TX bytes:610640897 (582.3 Mb)
Interrupt:11 Base address:0x6100

eth1 Link encap:Ethernet HWaddr 00:00:B4:54:51:AF
inet addr:64.217.15.253 Bcast:255.255.255.255 Mask:255.255.248.0
UP BROADCAST NOTRAILERS RUNNING MTU:1500 Metric:1
RX packets:124882 errors:0 dropped:0 overruns:0 frame:150
TX packets:96005 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:112146482 (106.9 Mb) TX bytes:23919554 (22.8 Mb)
Interrupt:9 Base address:0x6300

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8697 errors:0 dropped:0 overruns:0 frame:0
TX packets:8697 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:850546 (830.6 Kb) TX bytes:850546 (830.6 Kb)

I did, however, determine that swbell.net really does use PPPoE; now I'm wondering how I've managed to stay connected as well as I have, and why I wasn't able to configure the internet NIC (eth1, not eth0) for PPPoE using Mandrake Control Center... I did download a generic PPPoE script from the swbell ISP tech support site but am not certain how well it will work with the Mandrake setup, which is similar to Red Hat but not exactly the same in all respects...

DavidPhillips 12-19-2001 02:18 PM

I had no luck with their software, it was outdated and I had rp already installed.

I started by running adsl-setup, he gave me a name and password to enter.

By the time he could tell me they did not support Linux and I said thats ok you don't need to support it. I saw the lights flash a few times and I knew It was connected.

Don't let them give you any crap either. If the link light is flashing it's not in your system and it will came up when the light locks in. The only thing, you might have to power cycle the modem.

Ours went out last month and it took them a week to come out and give us a new modem, the other one had bit the dust.

If it goes out tell them you want a phone number for free dialup access until it's fixed. Your login and password will work. They did not hesitate to give me one. It was really something having 25 people on a dialup account.



moismoje 07-17-2004 06:15 PM

Same issue on a wireless isp connection
 
I get the same kind of issue when running on a Wireless ISP connection. Doing and ifconfig eth0 down and the a up doesn't renew the address, nor does running the network interface configuration. A reboot is the only thing I have found thus far that does it. The ISP connection is not a PPPoA/E type service. Basically it's a web page log in currently but they are supposed to be working on some other authentication types.

In my Mandrake 10 box I have 2 ethernet cards. Eth0 goes to a Linksys WET 11 bridge that connects to an antenna for my ISP connection. Thus it handles all the wirless configuration portion but is transparent as far as addressing is concerned. I will have to try the network restart command suggested above to see if that works.

One other thing...if that does work how would somone get that to run automatically? Right now I'm away from home and my connection has failed in this way. Is there a good script that you could use to detect if you have an active connection to the ISP gateway and if not to try some kind of reset commands to bring it back up?

DavidPhillips 07-18-2004 06:54 PM

You could actually have a script that runs all of the time which will ping an address to see if there is a connection, then restart networking if it's down. You may want to ping by name if it turns out to be a dns problem.

It would seem that if this uses dhcp you should be able to restart it using dhcpcd or dhclient.


All times are GMT -5. The time now is 05:24 PM.