Arduino Yun Not connecting to network via Ethernet

Hello All,

My Arduino Yun is not connecting to the network upon power up. I wait about 4-5 minutes after it has powered up and I cannot even ping the IP address. However once I pull the ethernet cable out, wait 5 seconds, and then plug it back in, it connects to the network within seconds. It never used to do this, I have been using the Arduino yun for a few months and never experienced this issue until about a week ago. I doubt it is the software as no software changes have been made since the initial programming I did a few months ago. I have attached my code below for your review. Any advice? Is the hardware known to give in after sometime like this?

PS I am using the Arduino Yun shield with the Leonardo as the base.

Thanks in advance.

Bridge_Update.ino (5.54 KB)

Quick fix is restore it to factory default.