VLAN configuration for CTs

MimCom

Active Member
Apr 22, 2011
204
3
38
Southwest NM
Trying to get VLANs working inside CTs on Proxmox 2.3 and having no luck. In order to remove as many variables as possible, I am not traversing an external switch, merely trying to connect to CTs on the same host to each other across a new VLAN.


First, I added a new veth to each CT (using one here as an example):


Screen Shot 2014-04-06 at 14.51.09 .png

Then, I configured the new interface in the CTs by creating /etc/network/interfaces.tail as follows
Code:
auto venet0:99    
iface venet0:99 inet static
        address 172.16.99.23
        netmask 255.255.255.255
    vlan-raw-device venet0
Then reboot the CT, but I don't see the new IP in the routing table and also lose connectivity through my existing interface (can ping myself, but not the router):
Code:
root@ns1:~# ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  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)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:127.0.0.2  P-t-P:127.0.0.2  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:42 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:10 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:5321 (5.3 KB)  TX bytes:4385 (4.3 KB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:192.168.44.23  P-t-P:192.168.44.23  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1


venet0:99 Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:172.16.99.23  P-t-P:172.16.99.23  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

root@ns1:~# netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         *               0.0.0.0         U         0 0          0 venet0
root@ns1:~# ping -c 5 192.168.44.23
PING 192.168.44.23 (192.168.44.23) 56(84) bytes of data.
64 bytes from 192.168.44.23: icmp_req=1 ttl=64 time=0.021 ms
64 bytes from 192.168.44.23: icmp_req=2 ttl=64 time=0.021 ms
64 bytes from 192.168.44.23: icmp_req=3 ttl=64 time=0.021 ms
64 bytes from 192.168.44.23: icmp_req=4 ttl=64 time=0.023 ms
64 bytes from 192.168.44.23: icmp_req=5 ttl=64 time=0.020 ms

--- 192.168.44.23 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3998ms
rtt min/avg/max/mdev = 0.020/0.021/0.023/0.003 ms
root@ns1:~# ping -c 5 192.168.44.1
PING 192.168.44.1 (192.168.44.1) 56(84) bytes of data.

--- 192.168.44.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 3998ms
Now rename the file and reboot:
Code:
root@ns1:~# mv /etc/network/interfaces.tail /etc/network/interfaces.tail.safroot@ns1:~# shutdown -r now
root@ns1:~# 
Broadcast message from root@ns1
    (/dev/pts/0) at 0:43 ...

The system is going down for reboot NOW!
Connection to ns1 closed by remote host.
Connection to ns1 closed.
otter:~ kurt$ ssh root@ns1

And the connectivity is back:
Code:
root@ns1:~# ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  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)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:127.0.0.2  P-t-P:127.0.0.2  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:45 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:5659 (5.6 KB)  TX bytes:4494 (4.4 KB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:192.168.44.23  P-t-P:192.168.44.23  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

root@ns1:~# ping -c 5 192.168.44.23
PING 192.168.44.23 (192.168.44.23) 56(84) bytes of data.
64 bytes from 192.168.44.23: icmp_req=1 ttl=64 time=0.019 ms
64 bytes from 192.168.44.23: icmp_req=2 ttl=64 time=0.019 ms
64 bytes from 192.168.44.23: icmp_req=3 ttl=64 time=0.023 ms
64 bytes from 192.168.44.23: icmp_req=4 ttl=64 time=0.021 ms
64 bytes from 192.168.44.23: icmp_req=5 ttl=64 time=0.024 ms

--- 192.168.44.23 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3999ms
rtt min/avg/max/mdev = 0.019/0.021/0.024/0.003 ms

root@ns1:~# ping -c 5 192.168.44.1
PING 192.168.44.1 (192.168.44.1) 56(84) bytes of data.
64 bytes from 192.168.44.1: icmp_req=1 ttl=63 time=142 ms
64 bytes from 192.168.44.1: icmp_req=2 ttl=63 time=0.183 ms
64 bytes from 192.168.44.1: icmp_req=3 ttl=63 time=0.170 ms
64 bytes from 192.168.44.1: icmp_req=4 ttl=63 time=0.171 ms
64 bytes from 192.168.44.1: icmp_req=5 ttl=63 time=0.152 ms

--- 192.168.44.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.152/28.568/142.165/56.798 ms

Any suggestions?

thanks~
 

Attachments

  • Screen Shot 2014-04-06 at 14.51.23 .png
    Screen Shot 2014-04-06 at 14.51.23 .png
    14.8 KB · Views: 9
Decided to simplify this down to another level by eliminating VLANs from the equation.

Added venet addresses to two CTs (172.16.88.23 and 172.16.88.25) and they can ping each other.
Code:
venet0:1  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:172.16.88.23  P-t-P:172.16.88.23  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

Added a secondary address to the router (172.16.88.1) and it can not be seen by either CT.
Code:
# ping -c 5 172.16.88.1
PING 172.16.88.1 (172.16.88.1) 56(84) bytes of data.

--- 172.16.88.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 3999ms

Added a secondary address to my workstation (172.16.88.99) and it can ping the router, but not reach either CT.

All hosts are on a single switch, no VLANs configured on switch at this time - every port is a trunk.

Edit: Untangle did not like virtio NICs, so I switched it to E1000's. Now my workstation, the router, and Untangle can all see each other, but none of them can see either of the CTs. This must be something obvious in the networking model that I don't understand.
 
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!