Is this in regards to your home connection? If you have a dynamic IP address (one that changes every time you reconnect) you will need to contact your ISP into acquiring a static IP (one that doesn't change every time you reconnect).
If this is a dedicated server in a datacentre - then the commands are as per below:
Note: you can use vi, nano or whichever editor may be the one that you use.
And enter as per below:
NETMASK=netmask (most likely 255.255.255.0 for you)
Once you have entered those values - you need to restart networking in order for these changes to apply:
service network restart