Setting Static IP
Hi
I have changed the file /etc/network/interfaces to the following to set a static IP but this does not seem to work: # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback iface eth0 inet static address 192.168.20.5 netmask 255.255.255.0 network 192.168.20.0 broadcast 192.168.20.255 gateway 192.168.20.2 dns-namesevers 121.98.0.1 121.98.0.2 Where am I going wrong? |
The gateway looks odd to me. They are usually xxx.xxx.xxx.001, but "usually" certainly doesn't mean always.
Here's a copy of my /etc/network/interfaces in case it helps. Code:
# The loopback network interface |
Also "does not seem to work" is a bit vague ... what actually happens? Does the interface come up, but still get a DHCP IP address? Does it not come up at all? Does it come up with the correct IP but is not able to communicate?
|
After I restart networking it only comes up with the local loopback details and nothing else.
|
no auto or allow-hotplug eth0 line. it doesn't realize there is an interface to bring up?
|
I have edited the file to be:
# interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback iface eth0 inet static address 192.168.20.1 netmask 255.255.255.0 gateway 192.168.20.2 then I write sudo service networking restart and then I get the following when typing ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1184 errors:0 dropped:0 overruns:0 frame:0 TX packets:1184 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:60502 (60.5 KB) TX bytes:60502 (60.5 KB) |
I'll say it again. Look at the differences between the lo and the eth0. You are missing a line. From my minecraft server.
Code:
jason@debian75:~$ cat /etc/network/interfaces |
thank you now I have a static IP
# interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.20.55 netmask 255.255.255.0 gateway 192.168.20.2 dns-nameservers 8.8.8.8 8.8.4.4 but I cant ping externally , nothing in IP tables seems to be blocking Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Resolv.conf is # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 192.168.20.1 nameserver 127.0.1.1 search Home # OpenDNS Fallback (configured by Linux Mint in /etc/resolvconf/resolv.conf.d/tail). nameserver 208.67.222.222 nameserver 208.67.220.220 Thank you. |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 06:57 AM. |