retspen / webvirtcloud

WebVirtCloud is virtualization web interface for admins and users
1.63k stars 362 forks source link

Assign static IP's #579

Closed nadermx closed 1 year ago

nadermx commented 1 year ago

Hi, great project. I was able to get everything set up, but now I have run into a problem I am not sure how to solve.

I have the following ip block assigned to me 38.106.79.129/25 and my host well say is on 38.106.79.130. Below are screen shots of my network and interface

image image

But when every I try and assign this

image

I end up with a server 500 error image

Even if I try with or without DHCP and/or fixed address.

I haven't been able where to find the error log specifically to see why its causing it? Any help would be useful as I want to be able to SSH into each VM I make with its own IP. Say .134 or .40

catborise commented 1 year ago

hi, it is working as expected, but you entered invalid ip address slice. you must enter 38.106.79.128/25 like that. image

ps: if you want to see what is happening, you could enable debug mode. (edit settings.py -> make debug=True)

nadermx commented 1 year ago

Okay that worked and thank you for the clarification,few questions for clarification, will this automatically assign an IP from that cloud? And if so, what happens when it exhausts that by chance? And lastly, is there any way to exclude certain ip's from that block. IE, the one's I don't have, 128 or 129

nadermx commented 1 year ago

I think I figured out, instead of setting DHCP, I just tick the fixed addresses I guess, thank you

nadermx commented 1 year ago

If possible, one last thing. So am able to set up an ubuntu instance, with an assigned ip address image And here is the network of cloud image But for some reason, when I am in the VPS, and I check the IP address, it gives me the ip address of the host image

and when I try and ping the IP address it gives me (242) it does not ping.

image If I try and make in the network tab a assigned ip it asks for a mac address? I feel I am so close. If from the host I ping the .242 it responds, but not from an outside ip

catborise commented 1 year ago

nat mechanism works like that. i dont know your network design but may be you must not use NAT mechanism. If we want use real ips for instance, we must not use NAT mechanism. as i understand you need dhcp but with static manner. remove cloud network, because you selected NAT type before. Create new one and try bridged or routed network modes.

nadermx commented 1 year ago

When you say try bridged, you mean what specifically? I set up like so, which gave me a static ip in the VPS, but I still can not ping that IP nor can I access the internet with that IP, so I think I need the bridge?

image image image As can be seen in the last image, it loggs in with an ip, and if i type ip address it gives me the same ip

nadermx commented 1 year ago

I guess to clarify, I got assigned the /25 block of ip's, and I want to be able to SSH into them from the internet. I believe there is a way to get it to work with webvirtcloud, or if not at least a way I Can run the commands on the host, to get it so webvirtcloud can still manage and auto assign the ips to the vm as it seems to be doing. I just seem to be missing in the config aspect

nadermx commented 1 year ago

I set it up this way image which acts weird in the sense the boxes show an IP, but have no internet acces. But if I ping something, it shows the IP of the domain.. image But never actually pings. So it has 100% packet loss, but dig works and returns the dns info

nadermx commented 1 year ago

I have made a bit of progress I think, I see that when I check the image It shows the bridge is down, and when I try and turn it on or delete it I get this "this function is not supported by the connection driver: virInterfaceCreate" image So I think this must be causing the lack of internet on the vm

catborise commented 1 year ago

these problems are not related with webvirtcloud. webvirtcloud is an only a ui for qemu/kvm + libvirt. Before webvirtcloud i recommend you to research network mechanism. before virtual machine, test real ips on host. give one of the real ips to host interface, then check connectivity. if it reach internet, then create a bridge without nat mechanism("bridge" type). then set instance network to use that bridge. because lack of the dhcp mechanism. instance will not get a ip address. set instance's ip address manually. then check again, internet access. if it is reachable, then shutdown instance. create another network bridge with dhcp.

nadermx commented 1 year ago

Thank you so much! I got it working with your help, as well as thes resources https://fabianlee.org/2022/09/20/kvm-creating-a-bridged-network-with-netplan-on-ubuntu-22-04/ https://forum.proxmox.com/threads/how-to-configure-static-ip-in-proxmox-vm.56341/