I would like to set static IP address on my Ethernet. I tried the nm-connection-editor program and it's too broken to use. I should report the bugs, but for now - what files can I edit manually to get a static IP address?
Also - where do I report bugs?
Thanks in advance.
Static IP on Ethernet
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Static IP on Ethernet
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Static IP on Ethernet
https://wiki.debian.org/NetworkConfiguration
If you're configuring it manually then something like this will set the default gateway (network, broadcast and gateway are optional):
auto eth0
iface eth0 inet static
address 192.0.2.7
netmask 255.255.255.0
gateway 192.0.2.254
Re: Static IP on Ethernet
I tried this:
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.2.240
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameservers 127.0.0.1
But it has no effect. It still does DHCP.
enp2s0 Link encap:Ethernet HWaddr 40:16:7e:e8:b7:88
inet addr:192.168.2.127 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::23e2:2f9e:67c3:606c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7599 errors:0 dropped:0 overruns:0 frame:0
TX packets:6163 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4993853 (4.9 MB) TX bytes:855455 (855.4 KB)
Thanks for your help.
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.2.240
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameservers 127.0.0.1
But it has no effect. It still does DHCP.
enp2s0 Link encap:Ethernet HWaddr 40:16:7e:e8:b7:88
inet addr:192.168.2.127 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::23e2:2f9e:67c3:606c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7599 errors:0 dropped:0 overruns:0 frame:0
TX packets:6163 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4993853 (4.9 MB) TX bytes:855455 (855.4 KB)
Thanks for your help.
Re: Static IP on Ethernet
Your interface ismperkel wrote: enp2s0 Link encap:Ethernet HWaddr 40:16:7e:e8:b7:88
.
enp2s0
, so replace eth0
with enp2s0
Command
ifconfig
tells interfaces.Re: Static IP on Ethernet
Thanks - that worked! Really appreciate that.administrollaattori wrote:Your interface ismperkel wrote: enp2s0 Link encap:Ethernet HWaddr 40:16:7e:e8:b7:88
.enp2s0
, so replaceeth0
withenp2s0
Commandifconfig
tells interfaces.