So, my eth0 interface in ubuntu 10.04(DVWA Machine) is configured with dhcp by default, but it is not taking an IP from the dhcp(in VirtualBox), that's why I want to assign a static IP. I have already made the change in /etc/network/interfaces from dhcp to static, like this:
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
And saved the changes, but each time I reboot the ubuntu machine I lose the config I made. Hence, I want to see if just by restarting the network/interface service I can get these changes to work.
I have tried to execute this command:
/etc/init.d/networking restart, but it fails, I got the error:
ifdown: couldnt read interfaces file "etc/network/interfaces"
Does anyone know how to restart the network service in UBUNTU 10.04? or how to solve my problem? I want to configure a static IP instead of DHCP.