From Gineipaedia, the Legend of Galactic Heroes wiki
Warships fielded defensive shields or screens. These were composed of two systems: one using magnetic fields and one using directional gravitational fields.
Strong magnetic fields protected against charged weapons such as electron beam cannons. Upon entering the magnetic field, the beam would be deflected, preventing the ship from being hit.
The gravitational field system was much more energy intensive and used to defend against electrically neutral weapons such as neutron beam cannons. Smaller ships such as destroyers and cruisers often ran this system on a low output "idling" mode, which then increased in power automatically upon detection of weapon fire due to an automatic feedback system. The most recent advances in this technology meant even solid projectile weaponry up to medium calibre railgun rounds could be affected sufficiently enough to alter their trajectory. (Data Book: Mechanic & Seiyū Encyclopaedia, p. 188-189)