change default network type to GRE mode, and move common functions to common.py