Post History
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...
Answer
#2: Post edited
- 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
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.