Remote Upload over Ethernet or serial - is RPI needed?

Can I program / upload to my Arduino Mega with Ethernet over an Ethernet connection from the IDE?
(I am using Com3 over USB serial at the moment)

My Arduino Mega with ethernet is installed in physical position that makes connecting to its USB port extremely difficult, and the installation of a 30m extension USB cable is not a good practice.

I want to be able to upload new code and (ideally) monitor the serial terminal as well

If I cant do it using ethernet does anyone aware of a solution using RPI as a serial port to ethernet converter? I am thinking a RPI located beside the Arduino Mega, connected USB to USB, then code on the RPI to transport the serial data (9600 is fine) over Ethernet to a "virtual com port" on my PC that is running the Arduino IDE.

If the "virtual com port" and the Arduino IDE wont play nicely together that other option is to have another RPI to convert the Ethernet back to USB serial beside the PC

Option 1
Arduino Mega usb - (rpi usb - rpi ethernet) - LAN - PC running IDE through a virtual com port

Option 2
Arduino Mega usb - (rpi usb - rpi ethernet) - LAN - - (rpi ethernet - rpi usb )- PC running IDE

Option 0
If you're using one of the W5x00 Ethernet controller chips then put the Ariadne bootloader on the Mega, which will allow you to upload over Ethernet. No RPi needed. If you're not using one of the W5x00 Ethernet controller chips then start using one.

Thanks Pert, it is the Wiznet W5100 using pins D4, D50, D51 and D52 on the ATmega2560 so I will give it a go!

Ariadne expects Arduino pin 10 to be used for the W5100 CS. It is possible to change that at spi.h, line 43, but you'll need to recompile the bootloader after that:

Good catch - thanks!