I know this is a bit of a long-shot but maybe there are some others with similar use-cases.
Right now Proxmox has integrated support for virtual-eth networking to containers and it works well.
I really want to be able to add interfaces to a container for network devices other than Ethernet, namely CAN for our use-case.
(Kernel support is provided via vxcan not vcan, there's a naming discrepancy in the kernel between the eth and can interface drivers.)
Alternatively, are there existing hooks we can use to trigger a script to run when a container is started?
We have scripts that will set-up the bridge between host devices and containers. If we could get it called with some environment variables set telling us all the information about the container and it's network, e.g. container ID and nsid, then we could just hook up our script.
For reference
Right now Proxmox has integrated support for virtual-eth networking to containers and it works well.
I really want to be able to add interfaces to a container for network devices other than Ethernet, namely CAN for our use-case.
(Kernel support is provided via vxcan not vcan, there's a naming discrepancy in the kernel between the eth and can interface drivers.)
Alternatively, are there existing hooks we can use to trigger a script to run when a container is started?
We have scripts that will set-up the bridge between host devices and containers. If we could get it called with some environment variables set telling us all the information about the container and it's network, e.g. container ID and nsid, then we could just hook up our script.
For reference
Bash:
# vxcan pair
candev=${1-can0}
vmid=${2-100}
nsid_cont=$(ip link show veth${vmid}i0 | grep link | awk -F'link-netnsid' '{ print $2 }')
ip link add $candev-vx${vmid} link-netnsid ${nsid_cont} type vxcan peer name vx$candev link-netnsid 0
ip link set dev $candev-vx$vmid mtu 16
ip link set dev $candev-vx${vmid} up
# CAN bridge
cangw -A -s $candev -d $candev-vx${vmid}
cangw -A -d $candev -s $candev-vx${vmid}