How to do these type of photos with a nikon d3000?

Thanks!

Put the camera in shutter priority mode (S mode) and set the shutter speed to 1 second or thereabouts. Put the camera on a tripod and wait until it is dark. Wait for a vehicle to pass, and release the shutter. A shutter-release remote is a good idea, so you don't knock the camera.

You don't need a DSLR to do that…
ANY camera can do it…
you need a tripod, a night, and a setting on the camera that increases the shutter time to about 1 second or more… This was done with a point and shoot:

That's low speed night photography.
You need a tripod or a good place to hold the camera still (the camera should not shake), and a combination of low speed and small aperture (use it in manual or shutter priority). Try different speeds until you get the effect you want. Start with 1 second and up.
Tutorials
Night Photography: Low Light Tips and Techniques
http://www.picturesocial.com/profiles/blog/show?id=1483478:BlogPost:3561
NIGHT PHOTOGRAPHY
http://www.paulpolitis.com/night_photography_tutorial.asp
25 Excellent Night Photography + Tutorials
http://psd-tutorial.com/night-photography-tutorial/