Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

40%
+0 −1
Q&A Static IP on wired LAN

I did this with NetworkManager. nmtui to open the TUI interface and then select "Edit..." and the ethernet connection You can also use the equivalent GUI or CLI commands, but I find them hard...

posted 1y ago by matthewsnyder‭  ·  edited 1y ago by matthewsnyder‭

Answer
#2: Post edited by user avatar matthewsnyder‭ · 2023-09-06T18:04:15Z (about 1 year ago)
  • I did this with NetworkManager.
  • * `nmtui` to open the TUI interface and then select "Edit..." and the ethernet connection
  • * You can also use the equivalent GUI or CLI commands, but I find them harder to use
  • * Next to `IPv4 Configuration`, click `Show` to see connection details.
  • * Go to `Addresses`, `<Add...>` and put in the IP that you want.
  • * I've seen people say you need to put in the Gateway as well but I didn't and it works anyway
  • * Everything else can be left as is
  • You may need to disconnect and reconnect.
  • But ultimately this set up will cause your computer to ask the router for a specific IP (the one you put in). It's then up to the router to decide whether to allow it. I've seen two common reasons why it would decide not to:
  • * The old IP has not expired yet, so you either have to wait (usually a few minutes or hours) or you have to flush it through the router's interface. Restarting the router might work as well.
  • * The router's range of allowed DHCP addresses doesn't cover your desired address. I'm not really sure if this is always necessary, in the past I've seen some routers grant the IP even though it's outside the DHCP. But if it doesn't work, it's worth trying to expand the DHCP range to include you desired IP.
  • In theory, there could also be an issue where some other device has already taken the IP you want. There are ways to solve that (which I'll leave to a separate question) but in practice this seems to be very rare.
  • I did this with NetworkManager.
  • * `nmtui` to open the TUI interface and then select "Edit..." and the ethernet connection
  • * You can also use the equivalent GUI or CLI commands, but I find them harder to use
  • * Next to `IPv4 Configuration`, click `Show` to see connection details.
  • * Go to `Addresses`, `<Add...>` and put in the IP that you want.
  • * I've seen people say you need to put in the Gateway as well but I didn't and it works anyway
  • * Everything else can be left as is
  • You may need to disconnect and reconnect.
  • But ultimately this set up will cause your computer to ask the router for a specific IP (the one you put in). It's then up to the router to decide whether to allow it. I've seen two common reasons why it would decide not to:
  • * The old IP has not expired yet, so you either have to wait (usually a few minutes or hours) or you have to flush it through the router's interface (for OpenWrt, see https://linux.codidact.com/posts/289617). Restarting the router might work as well.
  • * The router's range of allowed DHCP addresses doesn't cover your desired address. I'm not really sure if this is always necessary, in the past I've seen some routers grant the IP even though it's outside the DHCP. But if it doesn't work, it's worth trying to expand the DHCP range to include you desired IP.
  • In theory, there could also be an issue where some other device has already taken the IP you want. There are ways to solve that (which I'll leave to a separate question) but in practice this seems to be very rare.
#1: Initial revision by user avatar matthewsnyder‭ · 2023-09-06T17:46:36Z (about 1 year ago)
I did this with NetworkManager.

* `nmtui` to open the TUI interface and then select "Edit..." and the ethernet connection
    * You can also use the equivalent GUI or CLI commands, but I find them harder to use
* Next to `IPv4 Configuration`, click `Show` to see connection details.
* Go to `Addresses`, `<Add...>` and put in the IP that you want.
    * I've seen people say you need to put in the Gateway as well but I didn't and it works anyway
    * Everything else can be left as is

You may need to disconnect and reconnect.

But ultimately this set up will cause your computer to ask the router for a specific IP (the one you put in). It's then up to the router to decide whether to allow it. I've seen two common reasons why it would decide not to:

* The old IP has not expired yet, so you either have to wait (usually a few minutes or hours) or you have to flush it through the router's interface. Restarting the router might work as well.
* The router's range of allowed DHCP addresses doesn't cover your desired address. I'm not really sure if this is always necessary, in the past I've seen some routers grant the IP even though it's outside the DHCP. But if it doesn't work, it's worth trying to expand the DHCP range to include you desired IP.

In theory, there could also be an issue where some other device has already taken the IP you want. There are ways to solve that (which I'll leave to a separate question) but in practice this seems to be very rare.