How to assign static public ip to my VPS.

neeraj26jan

Member
Oct 28, 2020
3
0
6
41
Hi friends! Can someone guide me how to setup public static IP with my VPS?

I have flowing scenario right now.
  • I have Proxmox installed on my server
  • I have created a Virtual Machine on this server and installed Centos 7 OS and web host control panel so that i can use this as a web server.
  • I have got one static public IP from my internet service provider which i want to assign to my VPS and proxmox server on port 8006
  • I have a router behind my Proxmox server
What settings do i need to do in my router, host machine and guest machine (VPS) to assign the public ip to my VPS server. My current network interface settings are like this:

Code:
auto lo
iface lo inet loopback
iface enp3s0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.1.200
        netmask 255.255.255.0
        gateway 192.168.1.1
        bridge_ports enp3s0
        bridge_stp off
        bridge_fd 0

Thanks in advance!
 
Last edited:
hi,

I have got one static public IP from my internet service provider which i want to assign to my VPS and proxmox server on port 8006
do i understand correctly, that you have only one public IP and want to have a NAT setup to reach your VM?

in this case take a look at here [0]

I have a router behind my Proxmox server
router behind your proxmox server? so is your PVE server facing the internet or not?

if PVE is behind the router, then the public static IP will be of the routers.

[0]: https://pve.proxmox.com/wiki/Networ...ith_tt_span_class_monospaced_iptables_span_tt
 
hi,


do i understand correctly, that you have only one public IP and want to have a NAT setup to reach your VM?

in this case take a look at here [0]


router behind your proxmox server? so is your PVE server facing the internet or not?

if PVE is behind the router, then the public static IP will be of the routers.

[0]: https://pve.proxmox.com/wiki/Networ...ith_tt_span_class_monospaced_iptables_span_tt
Hi! Thank you so much for your response.

Yes i have got one public IP 103.74.XXX.XX and want to have NAT setup for my VM. Actually i want to use this as a VPS server.

I have a router and fiber internet directly coming to this router and then goes to server which has only one NIC. I have assigned a static LAN IP 192.168.1.200 from my router to my Proxmox PVE and created a bridge vmbr0 and my VM is connected with this bridge.

I have assigned a static IP 192.168.1.201 to my guest VM manually by going through network config file. Since guest VM has Centos OS, so my network settings look like this:

Code:
IPADDR=192.168.1.201
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
DNS2=8.8.4.4
DNS3=127.0.0.1

I have forwarded the port like 80, 443, 25 and many other to the IP 192.168.1.201 by going through the router settings.

Now I can access my VPS over the internet with my public IP 103.74.XXX.XX, but still not sure whether this is a right approach or not. Also with this settings i am getting No reverse DNS (PTR) error for MX A record, so gmail is rejecting my email.

Can you please suggest me if there is any changes i have to do also internally do i need to assign the Public IP 103.74.XXX.XX on my VM?

Thanks!
 
your setup sounds okay to me.

Also with this settings i am getting No reverse DNS (PTR) error for MX A record, so gmail is rejecting my email.
for this you would need to contact your ISP or hoster to add a PTR for your IP.
 

your setup sounds okay to me.


for this you would need to contact your ISP or hoster to add a PTR for your IP.
Okay. Since everything is being managed by myself. My ISP has only provided me the static IP upon request and payment on yearly basis. So they are only providing me the bandwidth and an IP which i want to use on my VPS. I have a physical server installed at my location. Right now i have pointed only one domain from my Godaddy account to my server after created nameserver.

I try to make you understand with example:

On my Godaddy account I have a domain say "mydomain.com". I have created two nameservers like this:

Host IP Addresses
ns1 103.74.XXX.XX
ns2 103.74.XXX.XX

Both nameservers have same IP. Now from the Godaddy DNS management I have used my custom nameserver:

ns1.mydomain.com
ns2.mydomain.com


Would you tell me please do I need to do anything else from my domain provider or from my server side like by going through BIND DNS from the server side?

Thank you so much!


 
Last edited:

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!