[SOLVED] VLAN to Guest

mhammett

Renowned Member
Mar 11, 2009
161
2
83
DeKalb, Illinois, United States
I have a CT where I added a second Ethernet port. One is for management and the other is for public access. I can't manage to get the second one to come up. When I do an ifup eth1, it hangs for about a minute and then reports `Failed to bring up eth1.` Thoughts?

Code:
root@libre:/etc/network# ifup eth1
Failed to bring up eth1.


Host interfaces file
Code:
root@stl-prox1:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto vmbr0
iface vmbr0 inet static
        address 10.0.199.20
        netmask 255.255.255.0
        gateway 10.0.199.1
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
        bridge-vids 2-4094
        bridge_vlan_aware yes

CT interfaces file


Code:
root@libre:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
iface lo inet6 loopback

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto eth0
#       gateway 10.0.199.1
iface eth0 inet static
        address 10.0.199.105
        netmask 255.255.255.0
        up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.0.199.1

iface eth0 inet6 dhcp

auto eth1
iface eth1 inet static
        address 172.97.108.82
        netmask 255.255.255.240
        gateway 172.97.108.81

iface eth1 inet6 dhcp

CT ifconfig

Code:
root@libre:~# ifconfig
eth0      Link encap:Ethernet  HWaddr fe:5b:55:aa:b5:dd
          inet addr:10.0.199.105  Bcast:10.0.199.255  Mask:255.255.255.0
          inet6 addr: fe80::fc5b:55ff:feaa:b5dd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7222 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2483774 (2.4 MB)  TX bytes:1710 (1.7 KB)

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:65536  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:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@libre:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr fe:5b:55:aa:b5:dd
          inet addr:10.0.199.105  Bcast:10.0.199.255  Mask:255.255.255.0
          inet6 addr: fe80::fc5b:55ff:feaa:b5dd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7247 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2487662 (2.4 MB)  TX bytes:1710 (1.7 KB)

eth1      Link encap:Ethernet  HWaddr 86:d4:2c:93:95:f3
          BROADCAST MULTICAST  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:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

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:65536  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:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

CT.conf

Code:
arch: amd64
cores: 4
hostname: libre.stl.midwest-ix.com
memory: 2048
net0: name=eth0,bridge=vmbr0,hwaddr=FE:5B:55:AA:B5:DD,ip=10.0.199.105/24,ip6=dhcp,type=veth
net1: name=eth1,bridge=vmbr0,gw=172.97.108.81,hwaddr=86:D4:2C:93:95:F3,ip=172.97.108.82/28,ip6=dhcp,tag=83,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-lvm:vm-105-disk-1,size=32G
swap: 4096
 
up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.0.199.1

why this line ?

shouldn't here setup a proper netmask on the interface enough ?

do you see anything suspicious when calling
( after a container reboot, to be sure your configuration changed were applied)
ifup --verbose eth1
 
I deleted the new interface so I could get back to work until someone more experienced could look over my shoulder. When I went through the steps I did with a friend over TeamViewer, I didn't have issues with ifup eth1 hanging anymore, though I did have issues with it coming up automatically at boot.

Back in PVE, I moved eth0 to eth2, eth1 to eth0 and eth2 to eth1 (basically swapping eth0 and eth1, but only in name). All works now. So strange....

The line you reference is so that when that interface comes up, a static route for 10.0.0.0/8 is added for that interface. All traffic destined for 10.0.0.0/8 (internal management traffic) will head out that interface and all other traffic (public Internet and bogons) will head out the other interface as it has the 0.0.0.0/0 route, catching everything else.

Those are proper netmasks.

I'll take a look at the --verbose option the next time I run into this. Unfortunately, I can't seem to be able to repeat that issue at this time.
 

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!