I'm doing my client side development in windows and my server side in linux (Which I run virtually). My client side socket is set to connect on the inet addr of my linux server (using localhost never seems to work for me, I guess because I'm running linux virtually).
My main problem is that my inet addr keeps changing (usually increments by 1) and then I have to rebuild my client code and transfer it over to the server which is very annoying.
Is there anyway to manually set my inet addr or to keep it from changing?
Thanks in advance.
Edit /etc/network/interfaces and define something like:
auto eth0
iface eth0 inet static
address 10.0.0.10
netmask 255.255.255.0
gateway 10.0.0.1
In this case, assuming your network address is 10.0.0.0/24, and the gateway (Windows machine) has the 10.0.0.1 as interface for your Linux machine. Also, this assumes you want to set the network interface eth0
.
Then:
$ sudo ifdown eth0
$ sudo ifup eth0
The first one is to shutdown the network interface and the second one is to re-activate it with the new settings.