Score:0

Public IP resetting every time I restart Ubuntu Server Linux machine

hu flag

I am running a Minecraft server on an Ubuntu Server Linux. I want people to be able to join publicly, so I got a public IP from my internet provider. I set it with the command "sudo ifconfig ens160 netmask " and the command "sudo ip route add default via ". It runs fine and people can join outside of my network with the IP I set up until I restart the machine. When I restart the Ubuntu Server, the IP resets completely. I have googled this and found some people want me to edit the /etc/network/interfaces file and it assumes I have that, but I don't. I tried creating it and adding all of the information the sites told me to, but that did not work either. Is there any way to set the IP and make it stay as that forever, even if I restart the machine?

Edit: The Ubuntu Server is running on a VMware machine's VM and the Ubuntu Server version is "Ubuntu 22.04.1 LTS".

David avatar
cn flag
It would depend on the version of Ubuntu you are using. You have failed to have that in your question. Please add with edit.
ru flag
What Ubuntu version are you using? Where is this server running? Is this a VPS? Need more information about your server and its environment to really answer anything here.
BeatThis101 avatar
hu flag
I edited, anyone can help?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.