Add NIC to existing VZ container

mattsl

New Member
Jan 25, 2012
2
0
1
I have container based VM running Asterisk. It currently has 1 bridged networking interface. eth0 on my Proxmox server is bridged via vmbr0/veth101.0 to eth0 on the VM. All I want to do is make eth1 on my server create a second bridged connection to a virtual eth1 on my container so I can have a public IP for SIP but still NAT all the admin stuff. I tried shutting down the VM, duplicating the settings in 101.conf for the first interface changing only the interface names and MAC addresses, but I can't seem to get it working correctly. Either the interfaces don't come up or only one of the two show up on the VM or they just disappear entirely. Can someone give me a quick step by step, including any necessary order and/or reboots required to make sure I didn't miss something simple? Also, I would prefer to burn a public IP on the Proxmox server as well as not have anything be able to connect to other than on my existing LAN's subnet. I think I can assign it an IP that is not part of my network and the bridging will still work, but can someone confirm this?

Thanks,

Matt
 
Hi Matt,
here is an working example:
Code:
NETIF="ifname=eth0,bridge=vmbr0,mac=CA:E3:43:25:79:66,host_ifname=veth104.0,host_mac=00:18:51:C5:C9:33;ifname=eth1,bridge=vmbr10,mac=CA:E3:43:25:79:55,host_ifname=veth104.1,host_mac=00:18:51:C5:C9:22"
How do you use your bridge should be equal (but some things only work with real nics). Trace down the issue with tcpdump on the host.

Udo
 
Thanks for the help udo.

I tried the code you had, but it still didn't work. I do have two interfaces on my container now, eth0 and eth1. And on my host I have veth101.0 and veth101.1 as well as vmbr0 and vmbr1. There is one concern I have. ifconfig on the host shows this in addition to the other interfaces:

Code:
venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet6 addr: fe80::1/128 Scope:Link
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

For the record, the MAC address in the container does match the MAC address specific in the 101.conf.

I also tried setting the IP for vmbr1 in the range I wanted eth1 on the container just to make sure that wasn't an issue. I then rebooted both machines. However, with doing all of that, the following is true:

ping from Heth0 to Veht0 - good
ping from Heth1 to my router on that network - good
ping from any other machine to Veth0 - good
ping from Heth1 to Veth1 - unreachable
ping from Veth1 to Heth1 - unreachable
ping from Veth1 to routher on that network - unreachable

I've double checked all the network configuration on the container and it's good.

Any ideas?