It doesn’t seem that they turned off network traffic within the country, though. Rather, they simply used Internet Protocol (IP) filtering to prohibit data originating from outside Libya to get in.
Contrast this with Egypt’s approach of turning off the route broadcasts. With Egypt’s approach, no Internet traffic would enter the country. It’s as if nobody can remember how to get there, and all of the maps were burned. When the route broadcasts are turned off, zero traffic will enter. At least once the routers forget how to get traffic there, which takes a little time.
So why did Libya do it differently?
This is pure speculation on my part, but I suspect that Qadhafi’s people are still accessing the Internet. If they want to have good connectivity, but prevent everyone else from same, they can set up IP filtering to allow a small range of Internet addresses through. By doing this, they can set up proxies somewhere outside of Libya, allow traffic from the addresses of those proxies to enter Libya’s network, and thus access nearly anything on the Internet that they wish.