Static Network Configuration Help

persevere

New Member
Sep 7, 2014
22
0
1
Hi Promox Friends,
I am using proxmox for the past 10 months and I am big fan of this now. Recently i extended network interfaces from 1 to 3. Here are the details

root@proxmox:~# cat /etc/network/interfaces
# network interface settings
auto lo
iface lo inet loopback


auto eth0
iface eth0 inet manual


auto eth1
iface eth1 inet manual


iface eth2 inet manual


auto vmbr0
iface vmbr0 inet static
address 192.168.1.13
netmask 255.255.255.0
gateway 192.168.1.1
bridge_ports eth0
bridge_stp off
bridge_fd 0


auto vmbr1
iface vmbr1 inet manual
bridge_ports eth1
bridge_stp off
bridge_fd 0


auto vmbr2
iface vmbr2 inet manual
bridge_ports eth2
bridge_stp off
bridge_fd 0




Is it Possible to access internet in the Guests whenever I configure ipaddress manually in the guest.

If i use NAT directly i can access the internet.
If I use Bridge network i can access the internet. [If i dont configure static ip address]

If I configure static ip's in the VM's how can i access internet. Please do the needful. Its very important to me to design my structure.
Thanks for help in advance.


Thanks
Persevere
 
Hello Persevere

auto vmbr0
iface vmbr0 inet static
address 192.168.1.13
netmask 255.255.255.0
gateway 192.168.1.1
bridge_ports eth0
bridge_stp off
bridge_fd 0

I guess the above is your internet connection in proxmox server behind a NAT router with 192.168.1.1 as gateway to internet

The other interfaces are not configured yet - seems to have no relevance for the actual subject.


If i use NAT directly i can access the internet.

You defined a kvm NAT !? (checked NAT in the proxmox GUI when defining vm´s NIC)
In that case you have 2 times (cascaded) NAT
1st: from VM which has got an IP from kvm´s DHCP server to proxmox
2nd: from proxmox via 192.168.1.1 to internet

If I use Bridge network i can access the internet. [If i dont configure static ip address]

Your VM is connected to 192.168.1.0/24 and has got an IP fron NAT router 192.168.1.1 via DHCP

If I configure static ip's in the VM's how can i access internet. Please do the needful. Its very important to me to design my structure.

In both mentioned above cases you can define a static address which matches to the (by DHCP) given network - but be careful to avoid double addresses.

Both of these solutions work (of course, you said already); which one to choose depends of your requests - I personally prefer the second one it is more transparent than kvm´s DHCP/NAT.

Kind regards

Mr.Holmes
 
Holmes,
Thanks for your support and i appreciate your support. I am totally confused with networking concepts in proxmox. That is my mistake.

eth0 -- plugged in ethernet cable from the router. And the router has the network 192.168.1.0/24. So the ip for proxmox is 192.168.1.13 [I provided while doing the installation]
eth1 -- Haven't configured yet
eth2 -- Haven't configured yet

Now my requirement is i want to create a Virtual machine [QEMU] with static ip on 192.168.1.0 network and want to access internet from that newly created VM. If i do bridge without static ip i am able to connect to internet. If i change that one to static i can't access internet. I need static because some installations related to oracle requires static ip. If i want to access some consoles/GUI running on that vm from my laptop [which is configured on 192.168.1.139] it should be bridged because if i use NAT i can't access the ip [which will be 10.*.*.*] from my laptop. Correct me if i am wrong.
So please help me in configuring the static ip on vm and accessing the internet from the ip.
Once again thanks for your support.


Thanks
Persevere
 
Holmes,
Thanks for your support and i appreciate your support. I am totally confused with networking concepts in proxmox. That is my mistake.

eth0 -- plugged in ethernet cable from the router. And the router has the network 192.168.1.0/24. So the ip for proxmox is 192.168.1.13 [I provided while doing the installation]
eth1 -- Haven't configured yet
eth2 -- Haven't configured yet

Now my requirement is i want to create a Virtual machine [QEMU] with static ip on 192.168.1.0 network and want to access internet from that newly created VM. If i do bridge without static ip i am able to connect to internet. If i change that one to static i can't access internet. I need static because some installations related to oracle requires static ip. If i want to access some consoles/GUI running on that vm from my laptop [which is configured on 192.168.1.139] it should be bridged because if i use NAT i can't access the ip [which will be 10.*.*.*] from my laptop. Correct me if i am wrong.
So please help me in configuring the static ip on vm and accessing the internet from the ip.
Once again thanks for your support.


Thanks
Persevere
Hi,
an bridge is simply an network hub - all interfaces (like eth0 or tap101i0) are connected together.

You need an second (or third) brigde for an new network - like 192.168.1.0/24 on vmbr0 and 192.168.20.0/24 on vmbr1 (or you named it vmbr20 because of 192.168.20.0/24).
If you use an seperate network, you need of course an gateway (router) in this network (the proxmox host isn't an router).

I'm not sure, but it's sounds that you have only one network - so simply use vmbr0 with bridged network; use an IP inside the guest of your network (like 192.168.1.222) and use your normal gateway and dns-server insid the VM also.

The only thing, why you can have trouble with such an config is, if your switch accept only one mac-address on the port where the pve-server is connected. Or the switch has trouble with arp.

Udo
 
Hello Persevere

The only thing, why you can have trouble with such an config is, if your switch accept only one mac-address on the port where the pve-server is connected. Or the switch has trouble with arp.

Probably not, because

If I use Bridge network i can access the internet. [If i dont configure static ip address]

What I understood the only one reason to not use this solution is that a static IP address is needed within the VM:

If i do bridge without static ip i am able to connect to internet. If i change that one to static i can't access internet. I need static because some installations related to oracle requires static ip. If i want to access some consoles/GUI running on that vm from my laptop [which is configured on 192.168.1.139] it should be bridged because if i use NAT i can't access the ip [which will be 10.*.*.*] from my laptop. Correct me if i am wrong.
So please help me in configuring the static ip on vm and accessing the internet from the ip.


The open item seems to be just "what to do in VM?"

Define static IP and default route 192.168.1.1 manually! How to do this depends on your guest OS. Attention: In some LINUX distros the settings in /etc/network/interfaces are overruled by GUI settings.

As an alternative (not recommended, use it only when you have troubles with the previoulsy described solution) you can use a seperate network and proxmox as NAT-router (but not with the built in from kvm but with iptables command; as already mentioned, proxmox is not a router, but route and NAT functions can be activated there by "route" and "iptables -t nat" commands).

Success!

Mr.Holmes
 
My special thanks to Mr.Holmes and udo.
I understand what you guys are trying to explain me. I will implement it tonight and will post the results. Once again thank you guys for your wonderful support and appreciate your help.


Thanks
Persevere
 
Holmes and udo,
Thanks for your wonderful support. You guys are technically awesome. Last night i tested with CentOS 6.5 with static configuration. It worked.

" Attention: In some LINUX distros the settings in /etc/network/interfaces are overruled by GUI settings. " awesome note. this is where exactly i went wrong. It was overwritten by network manager.
I read last friday for the first time that network manager can overwrite the settings but i didnt pay much attention.

Anyhow i was able to accomplish what exactly i want and i have to test it with OEL6.4. I will update you once my testing is done.
Once Again thank you guys. Appreciate your help

Thanks
Persevere.