Unable to Set Static IP To Proxmox Node

bugattiguy527

New Member
Jul 7, 2024
10
0
1
Hello! I have Proxmox VE running on my laptop (8.2.4). I have a standard Linux bridge with the configuration of this
Code:
auto vmbr0
iface vmbr0 inet dhcp
    bridge-ports enx0222796c7c62
    bridge-stp off
    bridge-fd 0
which works great, except for when I restart the node, anything connected to the bridge gets assigned to a new IP which is unfortunate since I keep having to change the ip of my Cloudflare tunnels since the IP changes. If I try to do a non-DHCP server such as this
Code:
auto vmbr0
iface vmbr0 inet static
   address 10.200.0.1/24
   netmask 255.255.255.0
   bridge_ports enx0222796c7c62
   bridge_stp off
   bridge_fd 0
then upon restarting networking or the machine itself, it breaks the wifi and says the network is unreachable, but as soon as I switch it back to dhcp, it works fine. I have tried many different types of configurations and IPs and nope, it didn't work. Do you have any ideas on how I can either get static vmbr0 to work or get DHCP to stop resetting the IP of my VMs and containers? Thanks!
 
You probably need to add a gateway to vmbr0 as well if you add a static IP
 
First of all, you're setting the subnet with both the CIDR notation (the /24 at the end of the IP) and netmask. Best use one or the other, not both.
Secondly, you're not setting a gateway, which is most likely why you can't reach the internet.
Thirdly, the .0.1 IP is 9 out of the 10 times the IP-address of the router itself, so an IP you should not use for your server.
Fourthly, using wifi to connect your server to internet is strongly discouraged, if you can, use a network-cable

Set it to dhcp, run the command ip a and post the results of that in here so we can give you a suggestion of what to use for your static settings.

(delayed send cause I forgot to press post)
 
You probably need to add a gateway to vmbr0 as well if you add a static IP
First of all, you're setting the subnet with both the CIDR notation (the /24 at the end of the IP) and netmask. Best use one or the other, not both.
Secondly, you're not setting a gateway, which is most likely why you can't reach the internet.
Thirdly, the .0.1 IP is 9 out of the 10 times the IP-address of the router itself, so an IP you should not use for your server.
Fourthly, using wifi to connect your server to internet is strongly discouraged, if you can, use a network-cable

Set it to dhcp, run the command ip a and post the results of that in here so we can give you a suggestion of what to use for your static settings.

(delayed send cause I forgot to press post)
Upon trying tihs configuration

Code:
auto vmbr0
iface vmbr0 inet static
    address 10.200.0.1
    netmask 255.255.255.0
    gateway 10.200.0.254 
    bridge_ports enx0222796c7c62
    bridge_stp off
    bridge_fd 0

and then restarting the node, the internet is still broken. Upon trying to ping 1.1.1.1 I get destination host unreachable and am unable to even ping my gateway. If I run ip a the bridge says its up and shows the inet ip of 10.200.0.1 like in the configuration. Obviously im not that great in this field of using linux but any ideas why this is still happening? I also tried using a different ip and got the same results. Also why is usigng wifi discouraged? My setup is using a old android phone using usb tethering to supply wifi since it supports a much newer network protocol for speed purposes.
 
It is (among other reasons) discouraged cause without extra setup it doesn’t work.
Wifi isn't installed by default, so you'll have to use "some" other route to get it to work.
A lot of wifi-devices will just block traffic if it is not coming from a mac-address that is already registered, so if the host were to register, any devices behind it wouldn't work because they all have different mac-addresses (and should else traffic wouldn't know where to go). This can be "worked around" by setting your server up as a router that does the translating for you, but then your server would still need to get internet by itself first.
On top of that, since you're calling it an old android phone, did you also check what usb-speeds it supports? Cause even if the wifi can reach gigabit speeds, if the port you're using is only usb 2.0, the theoretical max speed you would be able to get would be 480 Mbps (and real-world speed would probably be much lower then that as well)

Also, you never shown us the ip a (and maybe also ip r)results from DHCP

Finally, one other route you could take: DHCP-Reservations. Just about any router worth it's weight has the option to give a specific mac-address only a specific IP (and not give that IP to a different device, or give your server a different IP), even after a reboot or the like

That way you could keep DHCP on Proxmox, while keeping a static IP for your server too (be sure to set this new IP on your /etc/hosts file as well btw)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!