I am not an IT expert but it appears feasible to cut off most of 'the internet' from a small country or part of a small country in many situations.
Firstly, for a small nation, most internet sites are based in other larger countries and many smaller countries only have a limited number of connections to the rest of the world. For example, New Zealand only has four submarine cables connecting it to the rest of the world. If these are cut or if the junction points are controllable by country 1 then country 2 will lose access to all major international web sites sites including commercial (Google, Amazon, Alibaba), financial (international banks and stock exchanges), communication (overseas e-mail, zoom etc), social (facebook, twitter, tinder, etc), media (netflix, neon...). A larger small country may have some mirror sites for some of these organisations, but it will rapidly get out of date. Even in a nation with numerous links to the www, local regions of the country may only have a few vulnerable connections. Once again, taking NZ as an example, I believe the South Island has only one cable from the North Island which provides all its international traffic.
Secondly, when you type in a web address or an e-mail address (worldbuilding.stackexchange.com for example), your local server needs to know what IP address (the 123.456.321.654 thingy) to go to for a connection. 207
This relies on DNS root servers which act like giant centralized phone books. Your local internet service provider may cache some of these addresses but certainly not all of them. So if the country's local DNS servers are in the control of country 1, it may be impossible for a computer in country 2 to find where to connect to another site that is also in country 2.
Now country 2 may be able to solve some these problems - eventually. If they have some satellite connections then they could transfer communications to external servers via them - but in the short term this is likely to be expensive and provode only a very limited data service. If they have borders with sympathetic nations new land links could be added or upgraded or loaded up with more traffic. Even in the short term it woul dbe unlikely that country 1 could put country 2 in a total internet blackout forever, but there would likely be significant disruption for an extended period. 998