# Networkmanager (plasma-nm) creating temporary static ips?

## davidm

Hi this is probably a bit of a longshot here since I'm guessing most probably do not use NM but here is the situation.  I had a router get semi-bricked so I have to access the cfe miniwebserver to attempt to upload some firmware to try to recover it.  The way you do this on this model is by pressing reset on the router  for some seconds and trying to access the cfe at 192.168.2.1.  In order to do this though you need to set your computer to a static ip with 192.168.2.1 set as the gateway.  There is no dhcp automatically set.

So to do this I switched from my old config which was working fine otherwise because it wasn't able to handle switching the connection gracefully.  I figured network manager would be a good bet providing something like what I remember on Windows in the XP days where I could temporarily set up a static connection without having to tear apart my whole setup.  So now I have networkmanager and plasma-nm working well with my regular connection under kde 4.

The issue is how on Earth do you properly set up a wired manual ipv4 connection using plasma-nm?  I see the options and what appears to be correct but I am not certain I am doing this correctly.

1. Open plasma-nm

2. Create manual connection

3. under ipv4 tab set:

method manual

click ADD

then:

192.168.2.8 

netmask 255.255.255.0

gateway 192.168.2.1

and then I have "ipv4 is required for this connection" unchecked.

Nothing added to routes.  Then I disconnect from the regular auto connection,  unplug the physical ethernet connection, plug it back in, do what I need to on the router, connect to the new static connection within plasma-nm

Would this be correct?  

A Google search as you can imagine yields a huge mess of advice for different versions which aren't applicable.  Trying to access the CFE on a semi-bricked router is already difficult enough but doing so without knowing your other config is absolutely correct makes it exponentially more difficult.  Note this is just a temporary connection.  It's probably about a 80% chance the router is gone anyway.  So I'm not looking to set up a permanent static ip here.

----------

## russK

I know you asked how to do it through NetworkManager, but for something like this temporary thing I would just use a shell command.  

Something like this would make it an alias on your existing eth0:

```
ip addr add 192.168.2.8 dev eth0 label eth0:100
```

This would not add the gateway, just the static IP.

Not sure why you would leave the ipv4 option unchecked, by the way.

HTH

----------

## davidm

Hmmm.  I will try checking that box and giving it a shot.  I don't see why it shouldn't be checked either.  I had just assumed it was primarily used for overriding ipv6 which I mostly have disabled.

----------

## Fitzcarraldo

If you don't tick the box 'IPv4 is required for this connection' then you don't get 'may-fail=false' in the '[ipv4]' section in the file /etc/NetworkManager/system-connections/<connection name>, which means that an IPv4 connection is not mandatory. From 'man nm-settings':

```
      Table 13. ipv4 setting

       ┌───────────────────┬──────────────────────────┬───────────────┬───────────────────────────────────┐

       │Key Name           │ Value Type               │ Default Value │ Value Description                 │

       ├───────────────────┼──────────────────────────┼───────────────┼───────────────────────────────────┤

       │may-fail           │ boolean                  │ TRUE          │ If TRUE, allow overall network    │

       │                   │                          │               │ configuration to proceed even if  │

       │                   │                          │               │ the configuration specified by    │

       │                   │                          │               │ this property times out.  Note    │

       │                   │                          │               │ that at least one IP              │

       │                   │                          │               │ configuration must succeed or     │

       │                   │                          │               │ overall network configuration     │

       │                   │                          │               │ will still fail.  For example, in │

       │                   │                          │               │ IPv6-only networks, setting this  │

       │                   │                          │               │ property to TRUE on the           │

       │                   │                          │               │ NMSettingIP4Config allows the     │

       │                   │                          │               │ overall network configuration to  │

       │                   │                          │               │ succeed if IPv4 configuration     │

       │                   │                          │               │ fails but IPv6 configuration      │

       │                   │                          │               │ completes successfully.           │

```

----------

## davidm

Fitzcarraldo, thanks I will give it another shot and see if I can get it going with that set to true.

----------

