Unity doesn't recognize any definition for Network

I created a new project with the intent of learning how to create a server and connect to it but I have been stuck on the very first step:

if (Network.peerType == NetworkPeerType.Disconnected){

}

gives me an error CS0117
-error CS0117: Network' does not contain a definition for peerType’

I checked the scripting manual and everything seems to be in order.

Anyone might know whats the problem? Do I need scripting assets?

Edit: same thing happened for Network.connect(), he has no definition for it

My entire script

using UnityEngine;
using System.Collections;

public class Network : MonoBehaviour {

public string IP= "127.0.0.1";

public int port=123;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
void OnGUI(){ 
    if (Network.peerType == NetworkPeerType.Disconnected){

    }       
}

}