Yes, It is illegal.
Reason : Google AdSense 'Traffic exchange services may help bring traffic to your site, we don't recommend using them, as they may lead to invalid clicks or impressions and result in your account being disabled.'