By the Dúnedain
This is answered later in Fellowship of the Ring by Gandalf when he talks of calling for help from the Dúnedain and describes their watch has having been "doubled".
'That was seventeen years ago. Soon I became aware that spies of many sorts, even beasts and birds, were gathered round the Shire, and my fear grew. I called for the help of the Dúnedain, and their watch was doubled; and I opened my heart to Aragorn, the heir of Isildur.'
Fellowship of the Ring, Book 2, The Council of Elrond
Aragorn details the protections his people provide to the people of the North in an incredibly passionate speech at the Council of Elrond. I have included the whole speech because of how much I enjoy it, but have emboldened the important bits.
‘But my home, such as I have, is in the North. For here the heirs of Valandil have ever dwelt in long line unbroken from father unto son for many generations. Our days have darkened, and we have dwindled; but ever the Sword has passed to a new keeper. And this I will say to you, Boromir, ere I end. Lonely men are we, Rangers of the wild, hunters – but hunters ever of the servants of the Enemy; for they are found in many places, not in Mordor only.
‘If Gondor, Boromir, has been a stalwart tower, we have played another part. Many evil things there are that your strong walls and bright swords do not stay. You know little of the lands beyond your bounds. Peace and freedom, do you say? The North would have known them little but for us. Fear would have destroyed them. But when dark things come from the houseless hills, or creep from sunless woods, they fly from us. What roads would any dare to tread, what safety would there be in quiet lands, or in the homes of simple men at night, if the Dúnedain were asleep, or were all gone into the grave?
‘And yet less thanks have we than you. Travellers scowl at us, and countrymen give us scornful names. “Strider” I am to one fat man who lives within a day’s march of foes that would freeze his heart, or lay his little town in ruin, if he were not guarded ceaselessly. Yet we would not have it otherwise. If simple folk are free from care and fear, simple they will be, and we must be secret to keep them so. That has been the task of my kindred, while the years have lengthened and the grass has grown.
The lack of protection during the War of the Ring was acknowledged by the inhabitants of Bree (and foreshadowed the horrors that would be waiting for the Hobbits on their return to the Shire):
'You see, we’re not used to such troubles; and the Rangers have all gone away, folk tell me. I don’t think we’ve rightly understood till now what they did for us. For there’s been worse than robbers about. Wolves were howling round the fences last winter. And there’s dark shapes in the woods, dreadful things that it makes the blood run cold to think of. It’s been very disturbing, if you understand me.’
The Return of the King, Book 6, Homeward Bound