First you'll need to create a Custom Island (CP -> Portal -> Custom Islands), then you'll edit the forum details (CP -> Content -> Forums -> Details) and select the Custom Island as an Ad Island under "Custom Island Insert" in the "Custom Inserts" tab.
Now, you'll need to set the permissions for "Must view Ad Island" from the Forum Permissions (CP -> Content -> Forums -> Permissions or CP -> Permissions -> Forum).