2
1
I have read many posts that to change your PC between static and dhcp ip addressing you change your /etc/network/interfaces file and then restart the networking with:
/etc/init.d/networking restart
However when I do this, the restart seems to go ok, but (for example using a static address) I see that the ip address is unchanged (using ifconfig eth0
).
However when I do this manually:
sudo ifconfig eth0 192.168.3.20 netmask 255.255.255.0 up
Then it works fine, but only if I remove the "auto eth0" line from the networking file, otherwise DHCP is used.
So it looks like the networking file is used, but I can't get it to do static ip addresses :(
Here is my networking file contents:
#auto eth0 COMMENTED OUT
iface eth0 inet static
address 192.168.3.21 (USING .21 HERE TO DISTINGUISH BETWEEN MANUAL AND NETWORKING)
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
gateway 192.168.3.1
Am I doing somthing wrong?
Are you trying to use an IP address that is within the scope of your DHCP server? – duenni – 2015-10-12T11:56:27.010
You need to use the command
ifup eth0
– qasdfdsaq – 2015-10-12T11:57:44.057@duenni no, the IP address can be anything at all - it is for talking to some custom hardware that may have any ip address. – code_fodder – 2015-10-12T11:59:54.800
@qasdfdsaq ah, is that in the networking file after the
gateway 192.168.3.1
line? – code_fodder – 2015-10-12T12:00:33.053No. On the command line, instead of /etc/init.d/networking restart. – qasdfdsaq – 2015-10-12T12:05:21.237