A sol-gel assembly process was developed for the synthesis of magnetic core/carbon shell materials with porous networks. Fe(CO)5 was assembled into the pore channels of mesoporous silica via a sol-gel method at 18 °C, by using the block copolymer F127 as the template and Fe(CO)5 as an additional precursor. At this temperature, the magnetic precursor Fe(CO)5 was pre-organized into hydrophobic cores of micelles by self-assembly of F127. In the subsequent carbonization of the assembly under an Ar atmosphere, Fe(CO)5 transformed into magnetic nanoparticles and surfactant F127 transferred into carbon shells enveloping the magnetic nanoparticles, forming magnetic iron oxide core/carbon shell structures. The removal of the silica with 5% HF acid resulted in the core/shell nanoporous composite. The obtained system demonstrates a saturation magnetic value of 3 emu g−1 as well as a high surface area (98 cm2 g−1) and pore volume (0.21 m3 g−1), which would benefit its potential applications as adsorbents and catalysts, or applications in targeted drug delivery systems. This facile strategy would provide an efficient approach for tailoring core/shell porous materials with desired functionalities and structures by adjusting precursors and structure-directing agents.