0

I have set up a yaml file in folder '/etc/netplan' following the template:

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: false
      addresses:
        - my public ip from 'curl ipinfo.io/ip'
      gateway4: my gateway ip from 'ip route | grep default', e.g. it is 192.168.1.1 for log "default via 192.168.1.1 dev eth0"
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4

Also, I have set my nginx as

server {
    listen 80;

    server_name my_public_ip;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

I am sure my FastAPI server (hosted with Gunicorn and Nginx) works when I change the "my_public_ip" to the private IP address ('192.168.50.136') shown in VM summary page of the Proxmox UI.

I am still not able to send a request to my running server "my_public_ip_addr:80" ;_;

This is the summary of my Ubuntu 24.04 Server Virtual Machine

Proxmox Setting Image The first IP is my public ip from 'curl ipinfo.io/ip'.

Do I need to create another Network -> Linux Bridge? e.g. another CIDR, Gateway etc...

I am new to this, can anyone please help? Thank you!

I didnt setup ufw firwall

sudo ufw status
Status: inactive
5
  • Have you set up port forwarding in your router? By default your router has your public IP address. Forward port 80 in your router to the port 80 of 192.168.50.136.
    – user68186
    Commented Jun 14 at 19:29
  • @user68186 Hello! I am setting that up in my Proxmox. I am new to this. Can I setup port forwarding via command line? Currently I have no access to the router's configuration page.
    – houlin he
    Commented Jun 15 at 22:54
  • How is the network set up within proxmox and between proxmox and the router? I don't use proxmox.
    – user68186
    Commented Jun 15 at 23:35
  • @user68186 Proxmox manages multiple virtual machines on a single host server. It allocates resources to each virtual machine. I would say it is a management tool.
    – houlin he
    Commented Jun 18 at 5:48
  • I know what Proxmox is. Proxmox can be set up different kinds of network. You don't tell us how yours is set up. Are IP addresses to the VMs assigned by an external router, or by Proxmox?
    – user68186
    Commented Jun 21 at 15:32

1 Answer 1

0

I am assuming you have the public IP and the internal IP on the same interface.

If this is the case, make sure you setup up your firewall rules, to keep your system safe. I would recommend only opening ports you need and even then restrict access to the ports to be from ip addresses you know.

Do a search for iptables and you find a wealth of knowledge online.

You will need to enable ip forwarding and localnet route.

sysctl net.ipv4.conf.all.route_localnet=1 sysctl net.ipv4.conf.all.forwarding=1

You may need to setup nat routing, for any vm's that are running on the host, if proxmox has not already done so.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .