Not being able to connect with internet from LXC container

Hi there,

I have just started with the LXD installation in my ubuntu system. After running one ubuntu container in my host machine, I am facing networking issue from the LXC container, i.e, I am not being able to connect with the internet from the LXC container.

Everytime I am trying to apt install/update, it gives me Connection Timed Out.

The LXC container is up and running.

This is my ip address from the host machine -

aniket@aniket-HP-Notebook:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether b0:5a:da:59:b0:e9 brd ff:ff:ff:ff:ff:ff
3: wlp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether d8:5d:e2:b8:34:c7 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.7/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp4s0
valid_lft 7082sec preferred_lft 7082sec
inet6 fe80::7967:123:9e61:9a3e/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: wlxd46e0e0f6273: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether d4:6e:0e:0f:62:73 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.8/24 brd 192.168.0.255 scope global dynamic noprefixroute wlxd46e0e0f6273
valid_lft 6341sec preferred_lft 6341sec
inet6 fe80::c6f0:1574:67be:a2d9/64 scope link noprefixroute
valid_lft forever preferred_lft forever
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:c5:05:ea:7a brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
13: lxdbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:b3:cc:a8 brd ff:ff:ff:ff:ff:ff
inet 10.133.213.1/24 scope global lxdbr0
valid_lft forever preferred_lft forever
inet6 fd42:36e4:41b:58c0::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::216:3eff:feb3:cca8/64 scope link
valid_lft forever preferred_lft forever
15: vethccc7a370@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lxdbr0 state UP group default qlen 1000
link/ether 5a:b8:4b:02:8d:3d brd ff:ff:ff:ff:ff:ff link-netnsid 0

This is my ip address from the container -

root@sure-ox:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
14: eth0@if15: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:18:87:73 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.133.213.4/24 brd 10.133.213.255 scope global dynamic eth0
valid_lft 2289sec preferred_lft 2289sec
inet6 fd42:36e4:41b:58c0:216:3eff:fe18:8773/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 3206sec preferred_lft 3206sec
inet6 fe80::216:3eff:fe18:8773/64 scope link
valid_lft forever preferred_lft forever

Information about my machine -

  • Host Machine is Ubuntu 21.04
  • LXC container is created with Ubuntu 21.04

LXD has been installed with snap.

I am trying to narrow down my problem. Any help is appreciated. Plese do let me know if I need to furnish any other details.