i am runing dedicated server with opensuse,with public ip. i ordered subnet of public ips of /29. to use them for 6-7 lxc’s.
note; the dedicated server service provider; told me the ip subnet is routed to my server original ip, i mean the subnet is defrent ip structure.
i been trying many online guides most of them for debian but i am using opensuse. i appreciate any help?

Since a /29 subnet contains 8 IP addresses you will only get 5 for your LXCs if you assign the subnet to a bridge. (The server needs one address, and the first and last addresses can’t be used since they are the network and broadcast addresses.)

If you want to use more addresses then you could configure the bridge with a private subnet as usual, and route one public IP address to the private address of each LXC. I guess you need to configure a default route with the public address of the LXC specified as "src " in case you want to use the public address by default in outgoing connections.

Here’s a guide,

this guide for lxd, i am only using lxc though.

@mikma’s answer is correct there. Your best bet is to assign private addresses to your containers and route them a second IP from your public range.

Doing so would be done in a firewall script on your host combined with network configuration inside the container, no special LXC configuration needed.

Hi, for lxc on public ip i am using macvlan now, where i assign the the mac on the config file of the lxc container, is this the right way of using public static ips for MULTIPLE containers on production?

macvlan is unlikely to work in the case where your hosting provider routes that subnet to your host, it’d work fine if they were just routing that subnet to the subnet your host sits on though.

now i am not using subnet, they rout the public ips by mac, so i am using it that way, and connectivity is fine, i been reading on that routing will increase cpu usage because it routs packets constantly, well in my case dose macvlan use cpu as taht much ?
in my other thread of Lxc_eating_memory can using multiple ips with macvlan be the reason why cache fill up quickly?