A suicide bomber attacked a Pakistani army base near the Afghan border just days after both countries agreed to a ceasefire.