I rout barrel channels with a router in a router table, with a fence on the table, and a feather board pushing the stock to the fence. Leave the stock blank full hight and rout to full depth of barrel thickness one flat wide. I do this in several passes, don't gag your router trying to do it in one cut. I then cut the channel full width of barrel to the full depth of the side flats, again taking several passes to reach full depth. Most important is a mark on the table showing the forward edge of the bit, and a corresponding mark on the stock at the breach end. Don't be shy about stopping a little short of that mark. You also want to feed the stock in where the rotation of the bit pushes the stock toward the fence, don't ask me how I know this. When you're widening the side channel on one side, you need to turn and feed the stock from the other direction to get the rotation right. Don't forget to remark the forward edge of the bit on your table, the old mark is now on the back side of the bit when you feed from the other end
To remove the meat left in the bottom angles between the full depth and full width, I made a bit for my old Stanley router plane that is 45 degrees from vertical. I just pull it along till the angled flats are cut.
I also use this setup to cut the ramrod groove, after I've cut the stock to full depth at the forend, but prior to cutting it down to half the thickness of the ramrod.
At this point I'm ready to cut the sides of the channel down to half the barrel hight. You can even do that on the router table with a staggered fence. Ditto for cutting the forend to half the depth of the ramrod groove.
I've also cut barrel channels on a table saw, with a full hight stock blank, making multiple passes, and a piece of tape with a pencil mark on it where to stop feeding into the blade. This method is tedious, and leaves a lot of wood left to remove at the breach end of the channel, but it is accurate. With either method I suggest using a scrap piece to verify settings.