# home desktop loses dhcp



## azathoth (Nov 4, 2017)

Sometimes I torrent a lot and my isp shuts off my net.

Reboot fixes.

This being unix I hate to reboot though!

Someone said in addition to service netif restart I need service routing restart or something.
I think I tried that and no go.

Do I need to restart dhcp too? or?


----------



## ShelLuser (Nov 4, 2017)

You can always try using dhclient.


----------



## antranigv (Nov 4, 2017)

hey! it depends on what does your ISP do. `service netif restart` will restart your network interfaces, and depends on the configuration, wpa_supplicant (WiFi) and dhclient might restart as well.

any idea on how does your ISP shutdown your connection?


----------



## scottro (Nov 4, 2017)

the netif and routing restarts are for things like when you've changed your network configuration in /etc/rc.conf.  Doing something like `sudo pkill dhclient` and `dhclient re0` (for example, if your interface is re0) will stop dhclient and restart it, requesting a new address from your ISP. 

You could also probably just restart the cable or FIOS modem or your router if you have one. It depends how you connect, for example, I have a cable modem that goes to a router, so if there was ISP connectivity issues, I would at the modem first.


----------



## PacketMan (Nov 6, 2017)

Having worked with service providers (in Canada) for the very vast majority of my career I can say I have never hear of that kind of practice before, and I'm not heard any of my USA colleagues speak of that either.  But, times are changing, just when you think you know it all......

So do you have some sort of router/NAT/firewall between your FreeBSD machine and your ISP, or does the ISP connection plug directly into your machine?  When the ISP shutdowns your net connection/service, do you see link down on your machine, or just no traffic? Is there absolutely no traffic, or does it just come to a crawl? Can you ping a DNS server that is out on the Internet? What does `ifconfig` reveal?

But even without the answers to those questions, here is what I am thinking:  Something is malfunctioning, versus this being an automated shutdown due to some sort of traffic enforcement policy.  If your ISP hates bittorrent they have many forms of 'policing' mechanisms to throttle bittorrent traffic.  I'm wondering if somehow your router or the NIC in your FreeBSD box is loosing its marbles when all that bittorrent traffic pounds it.  My old home route would freak out sometimes because the NAT resources would get exhausted due to the number of torrent peers.  I simply changed the torrent setting from something like 500 peers to 25 and that took care of that issue.

Try unplugging the cable between the FreeBSD machine and what ever is connected to it and see what happens.  If there is indeed a router/nat/firewall appliance then try unplugging the cable between it and your ISP.


----------



## SirDice (Nov 6, 2017)

Just a guess but it's possible your firewall rules are blocking DHCP requests and responses. Typically a DHCP lease is set to an hour or so. After half that time it will try to re-register. If that fails it will try again at 3/4 of the time. If this all fails the IP address is released when the lease expires, i.e. you lose your IP address and as a consequence your connection.


----------



## azathoth (Nov 8, 2017)

scottro said:


> the netif and routing restarts are for things like when you've changed your network configuration in /etc/rc.conf.  Doing something like `sudo pkill dhclient` and `dhclient re0` (for example, if your interface is re0) will stop dhclient and restart it, requesting a new address from your ISP.
> 
> You could also probably just restart the cable or FIOS modem or your router if you have one. It depends how you connect, for example, I have a cable modem that goes to a router, so if there was ISP connectivity issues, I would at the modem first.



reboot fixes
so I think the dhclient thing might be the answer
this is unix
we dont need reboots right?


----------



## azathoth (Nov 8, 2017)

SirDice said:


> Just a guess but it's possible your firewall rules are blocking DHCP requests and responses. Typically a DHCP lease is set to an hour or so. After half that time it will try to re-register. If that fails it will try again at 3/4 of the time. If this all fails the IP address is released when the lease expires, i.e. you lose your IP address and as a consequence your connection.


oh its surely the isp
onyl happens when torenting hard
and reboot fixes
sneeky bugger rcn here in boston
bastards doing bandwidth shaping no doubt


----------



## SirDice (Nov 9, 2017)

Bandwidth shaping doesn't make you lose your IP address or disconnects you. It just makes things slower.


----------



## Max212 (Nov 9, 2017)

Is your computer directly connected to internet?
When you have issues and dhclient does not renew IP address, did you check at that time how many connections do you have and how many connections per second are trying to establish?


----------

