Lincoln is correct if you just want to do pure link layer encryption that code snippet will do it. The AAA stuff facilitates automatic key distribution