But in Friday's interview with The Associated Press, General Pervez Musharraf said Pakistan cannot afford by itself what would be a major undertaking through mountainous terrain and deeply conservative tribal regions.
"We could do selective fencing," he suggested as an alternative to an unbroken barrier.
Pakistan has about 80,000 troops at the border. Taliban-led fighters, hoping to disrupt Afghanistan's 18 September legislative elections, are believed to have sought sanctuary in parts of the tribal regions, drawing criticism from Afghan and US officials.
Attacks have recently increased on US-led coalition and Afghan forces in Afghanistan.
Pakistan has also set up 40-50 mobile checkpoints and sent six transport helicopters and three helicopter gunships to the frontier "to beef up security and curtail activities of miscreants," Pakistan army spokesman Major-General Shaukat said on Tuesday.
Pakistani officials often use the term "miscreants" to describe militants.
A similar clampdown by Pakistani forces on the border area ahead of Afghan presidential elections in October was credited with decreasing militant activity inside Afghanistan. That vote was relatively peaceful.
Musharraf praised Afghan President Hamid Karzai's efforts to unite a country with no history of national unity and divided by decades of war, but said the military also needs to continue to improve security and that substitutes need to be found for farmers now producing opium in order to squelch drug trafficking.
"Converting a tribal, feudal society into a homogenous body under a democratic set up is not that easy"
"Other than militancy and terrorism that's going on, Afghanistan is a tribal society," Musharraf said. "There are warlords with their own militia and military. In the past they had their own aircraft, tanks and guns. This is Afghan society.
"I know President Karzai is trying to harmonise the society toward a democratic outlook... But converting a tribal, feudal society into a homogenous body under a democratic set up is not that easy. It will take some time. "We will remain supportive to all that they are doing."