1
I want to change my Ubuntu to static IP. My current IP setting is:
eth0 Link encap:Ethernet HWaddr 00:0c:29:xx:xx:xx
inet addr:192.168.16.59 Bcast:192.168.31.255 Mask:255.255.240.0
inet6 addr: fe80::20c:xx:xx:xx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:234690 errors:0 dropped:0 overruns:0 frame:0
TX packets:1864 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:22953435 (22.9 MB) TX bytes:205616 (205.6 KB)
what should I put as the network
in /etc/network/interfaces (note the network mask of 255.255.240.0
)?
What exactly do you have trouble with? I don't see any
network
statements ininterfaces(5)
. You might consider rephrasing your question and add some details. – Andreas Wiese – 2014-03-31T19:56:24.8731Stop using
ifconfig
, useip addr
instead. This is whatifupdown
(the software that parses/etc/network/interfaces
) uses under the hood anyway, so you will definitely want to get used to it. – BatchyX – 2014-03-31T20:06:09.840@BatchyX, I use
ip addr
for other things but not this one, because it'd be worse thatifconfig
--ifconfig
at least gives me address, broadcast & netmask, butip addr
doesn't give me netmask, at least my version doesn't. – xpt – 2014-04-01T02:40:52.493@xpt:
ip addr
gives you the modern CIDR prefix length just next to the IP address. It also accept old-style netmask on input (i.e.192.168.31.254/255.255.240.0
) – BatchyX – 2014-04-02T17:52:31.950