Hello,
I want to set a specify a public to a container to avoid NAT. My network look like so,
The ISP has provided a fiber modem which is in bridge mode. I have connected it to a switch which has a VLAN 100 defined. The switch tags the traffic and connects to the server which has the LXD container.
The LXD host netwok looks like this,
$ ip link show vlan100
60: vlan100@eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 12:34:56:78:12:23 brd ff:ff:ff:ff:ff:ff
tcpdump on vlan100 interface shows the arp requests coming from WAN side, so i know it is working.
The ISP has provided me a public ip address (e.g. 202.16.1.2) which i want to assign to a container. It is not clear to what kind of network should i use.
I tried the routed approach for debian like this, but the container is not able to ping the internet.
#lxc profile show routed_debian
config:
user.network-config: |
#cloud-config
version: 2
ethernets:
eth0:
dhcp4: false
dhcp6: false
routes:
- to: 0.0.0.0/0
via: 169.254.0.1
on-link: true
user.user-data: |
#cloud-config
bootcmd:
- echo 'nameserver 8.8.8.8' > /etc/resolvconf/resolv.conf.d/tail
- systemctl restart resolvconf
description: Default LXD profile
devices:
eth0:
ipv4.address: 202.16.1.2
name: eth0
nictype: routed
parent: vlan100
type: nic
name: routed_debian
used_by:
- /1.0/instances/turnpublic
Any help would be much appreciated.