Poroblem when i use upstream in hosts and open ports in the container

hi ,

i use my host for upstream and i created a container with ubuntu 14.04 for another application when i open multi ports fro the application in the container thy do not work while the upstream working in the host but when i stop the upstream in the host all ports in the container are work
in fact i want to make both of them work …upstream in the host and the application in the container
is there is any solution please?

Please show lxc config show <instance> --expanded and lxc network show <network> as well as ip a and ip r on the host and inside the instance.

so sorry i do not understand if you want to give the result here?

Yes please

lxc config show linux14
architecture: x86_64
config:
  image.architecture: amd64
  image.description: ubuntu 14.04 LTS amd64 (release) (20191107)
  image.label: release
  image.os: ubuntu
  image.release: trusty
  image.serial: "20191107"
  image.version: "14.04"
  volatile.base_image: 97ca81741254148eae6a20e1d8f087d90a2bbf1b6c6116459bcdbe5dc5148ce3
  volatile.eth0.hwaddr: 00:16:3e:b0:8f:3f
  volatile.idmap.base: "0"
  volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
  volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
  volatile.last_state.power: RUNNING
devices:
  myport80:
    connect: tcp:127.0.0.1:80
    listen: tcp:0.0.0.0:80
    type: proxy
  myport1111:
    connect: tcp:127.0.0.1:1111
    listen: tcp:0.0.0.0:1111
    type: proxy
  myport1777:
    connect: tcp:127.0.0.1:1777
    listen: tcp:0.0.0.0:1777
    type: proxy
  myport4442:
    connect: tcp:127.0.0.1:4442
    listen: tcp:0.0.0.0:4442
    type: proxy
  myport5511:
    connect: tcp:127.0.0.1:5511
    listen: tcp:0.0.0.0:5511
    type: proxy
  myport5555:
    connect: tcp:127.0.0.1:5555
    listen: tcp:0.0.0.0:5555
    type: proxy
  myport6666:
    connect: tcp:127.0.0.1:6666
    listen: tcp:0.0.0.0:6666
    type: proxy
  myport8000:
    connect: tcp:127.0.0.1:8000
    listen: tcp:0.0.0.0:8000
    type: proxy
  myport8001:
    connect: tcp:127.0.0.1:8001
    listen: tcp:0.0.0.0:8001
    type: proxy
  myport8002:
    connect: tcp:127.0.0.1:8002
    listen: tcp:0.0.0.0:8002
    type: proxy
  myport8003:
    connect: tcp:127.0.0.1:8003
    listen: tcp:0.0.0.0:8003
    type: proxy
  myport8004:
    connect: tcp:127.0.0.1:8004
    listen: tcp:0.0.0.0:8004
    type: proxy
  myport8005:
    connect: tcp:127.0.0.1:8005
    listen: tcp:0.0.0.0:8005
    type: proxy
  myport8006:
    connect: tcp:127.0.0.1:8006
    listen: tcp:0.0.0.0:8006
    type: proxy
  myport8007:
    connect: tcp:127.0.0.1:8007
    listen: tcp:0.0.0.0:8007
    type: proxy
  myport8008:
    connect: tcp:127.0.0.1:8008
    listen: tcp:0.0.0.0:8008
    type: proxy
  myport8009:
    connect: tcp:127.0.0.1:8009
    listen: tcp:0.0.0.0:8009
    type: proxy
lxc network show enp0s31f6
config: {}
description: ""
name: enp0s31f6
type: physical
used_by: []
managed: false
status: ""
locations: []

OK and what is the problem?

i use the hosts in upstream and use the container to run another application … when i run the application in the container while the upstream running in hosts all ports in the container do not work except port 80 it works very good but the rest of ports do not work

when i stopped the upstream in the hosts all ports in the container are work !!! i saw your reply in one of topics the you say if there is a firewall or upstream in the host tat will make the problem!!

Please show ss -tlpn on the host and inside the container.

Also please clarify “upstream” in this context.

in the host

root@Ubuntu-1804-bionic-64-minimal ~ # ss -tlpn
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 0.0.0.0:8080 0.0.0.0:* users:((“nginx”,pid=19226,fd=5),(“nginx”,pid=19225,fd=5),(“nginx”,pid=19223,fd=5),(“nginx”,pid=19222,fd=5),(“nginx”,pid=19221,fd=5),(“nginx”,pid=19220,fd=5),(“nginx”,pid=19219,fd=5),(“nginx”,pid=19218,fd=5),(“nginx”,pid=19217,fd=5))
LISTEN 0 32 10.95.194.1:53 0.0.0.0:* users:((“dnsmasq”,pid=2112,fd=9))
LISTEN 0 128 127.0.0.53%lo:53 0.0.0.0:* users:((“systemd-resolve”,pid=1801,fd=13))
LISTEN 0 128 0.0.0.0:25462 0.0.0.0:* users:((“nginx_rtmp”,pid=19216,fd=6),(“nginx_rtmp”,pid=19214,fd=6))
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:((“sshd”,pid=1861,fd=3))
LISTEN 0 128 0.0.0.0:31210 0.0.0.0:* users:((“nginx_rtmp”,pid=19216,fd=7),(“nginx_rtmp”,pid=19214,fd=7))
LISTEN 0 128 *:8015 : users:((“lxd”,pid=4457,fd=6),(“lxd”,pid=4457,fd=4))
LISTEN 0 128 *:30031 : users:((“lxd”,pid=3261,fd=6),(“lxd”,pid=3261,fd=4))
LISTEN 0 128 *:12047 : users:((“lxd”,pid=1696,fd=6),(“lxd”,pid=1696,fd=4))
LISTEN 0 128 *:12015 : users:((“lxd”,pid=880,fd=6),(“lxd”,pid=880,fd=4))
LISTEN 0 128 *:8016 : users:((“lxd”,pid=4481,fd=6),(“lxd”,pid=4481,fd=4))
LISTEN 0 128 *:80 : users:((“lxd”,pid=4107,fd=6),(“lxd”,pid=4107,fd=4))
LISTEN 0 128 *:30032 : users:((“lxd”,pid=3288,fd=6),(“lxd”,pid=3288,fd=4))
LISTEN 0 128 *:30000 : users:((“lxd”,pid=2475,fd=6),(“lxd”,pid=2475,fd=4))
LISTEN 0 128 *:12048 : users:((“lxd”,pid=1722,fd=6),(“lxd”,pid=1722,fd=4))
LISTEN 0 128 *:12016 : users:((“lxd”,pid=893,fd=6),(“lxd”,pid=893,fd=4))
LISTEN 0 128 *:8017 : users:((“lxd”,pid=4496,fd=6),(“lxd”,pid=4496,fd=4))
LISTEN 0 128 *:55569 : users:((“lxd”,pid=4061,fd=6),(“lxd”,pid=4061,fd=4))
LISTEN 0 128 *:30033 : users:((“lxd”,pid=3314,fd=6),(“lxd”,pid=3314,fd=4))
LISTEN 0 128 *:30001 : users:((“lxd”,pid=2494,fd=6),(“lxd”,pid=2494,fd=4))
LISTEN 0 128 *:1777 : users:((“lxd”,pid=2313,fd=6),(“lxd”,pid=2313,fd=4))
LISTEN 0 128 *:12049 : users:((“lxd”,pid=1752,fd=6),(“lxd”,pid=1752,fd=4))
LISTEN 0 128 *:12017 : users:((“lxd”,pid=915,fd=6),(“lxd”,pid=915,fd=4))
LISTEN 0 128 *:8018 : users:((“lxd”,pid=4523,fd=6),(“lxd”,pid=4523,fd=4))
LISTEN 0 128 *:50002 : users:((“lxd”,pid=3929,fd=6),(“lxd”,pid=3929,fd=4))
LISTEN 0 128 *:30034 : users:((“lxd”,pid=3340,fd=6),(“lxd”,pid=3340,fd=4))

in the container

ss -tlpn
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:12056 : users:((“memoexcha”,2177,76))
LISTEN 0 128 *:12024 : users:((“memoexcha”,2177,45))
LISTEN 0 128 *:30040 : users:((“memosameh”,2174,66))
LISTEN 0 128 *:30008 : users:((“memosameh”,2174,33))
LISTEN 0 128 *:8024 : users:((“memovips”,2179,50))
LISTEN 0 128 *:12057 : users:((“memoexcha”,2177,77))
LISTEN 0 128 *:12025 : users:((“memoexcha”,2177,46))
LISTEN 0 128 *:30041 : users:((“memosameh”,2174,67))
LISTEN 0 128 *:30009 : users:((“memosameh”,2174,34))
LISTEN 0 128 *:8025 : users:((“memovips”,2179,51))
LISTEN 0 128 *:12058 : users:((“memoexcha”,2177,78))
LISTEN 0 128 *:12026 : users:((“memoexcha”,2177,47))
LISTEN 0 128 *:30042 : users:((“memosameh”,2174,68))
LISTEN 0 128 *:30010 : users:((“memosameh”,2174,35))
LISTEN 0 128 *:8026 : users:((“memovips”,2179,52))
LISTEN 0 128 *:12059 : users:((“memoexcha”,2177,79))
LISTEN 0 128 *:12027 : users:((“memoexcha”,2177,48))
LISTEN 0 128 *:30043 : users:((“memosameh”,2174,69))
LISTEN 0 128 *:30011 : users:((“memosameh”,2174,36))
LISTEN 0 128 *:8027 : users:((“memovips”,2179,53))
LISTEN 0 128 *:12060 : users:((“memoexcha”,2177,80))
LISTEN 0 128 *:12028 : users:((“memoexcha”,2177,49))
LISTEN 0 128 *:30044 : users:((“memosameh”,2174,70))
LISTEN 0 128 *:30012 : users:((“memosameh”,2174,37))
LISTEN 0 128 *:8028 : users:((“memovips”,2179,54))
LISTEN 0 128 *:15901 : users:((“memoexcha”,2177,93))
LISTEN 0 128 *:12061 : users:((“memoexcha”,2177,81))
LISTEN 0 128 *:12029 : users:((“memoexcha”,2177,50))
LISTEN 0 128 *:30045 : users:((“memosameh”,2174,71))
LISTEN 0 128 *:30013 : users:((“memosameh”,2174,38))
LISTEN 0 128 *:8029 : users:((“memovips”,2179,55))
LISTEN 0 128 *:12062 : users:((“memoexcha”,2177,82))
LISTEN 0 128 *:30046 : users:((“memosameh”,2174,72))
LISTEN 0 128 *:30014 : users:((“memosameh”,2174,39))
LISTEN 0 128 *:12063 : users:((“memoexcha”,2177,83))
LISTEN 0 128 *:12031 : users:((“memoexcha”,2177,51))
LISTEN 0 128 *:30047 : users:((“memosameh”,2174,73))
LISTEN 0 128 *:30015 : users:((“memosameh”,2174,40))
LISTEN 0 128 *:12000 : users:((“memoexcha”,2177,91))
LISTEN 0 128 *:12064 : users:((“memoexcha”,2177,84))
LISTEN 0 128 *:12032 : users:((“memoexcha”,2177,52))
LISTEN 0 128 *:30048 : users:((“memosameh”,2174,74))
LISTEN 0 128 *:30016 : users:((“memosameh”,2174,41))
LISTEN 0 128 *:8000 : users:((“memovips”,2179,25))
LISTEN 0 128 *:7777 : users:((“memoexcha”,2177,90))
LISTEN 0 128 *:12065 : users:((“memoexcha”,2177,85))
LISTEN 0 128 *:12033 : users:((“memoexcha”,2177,53))
LISTEN 0 128 *:30049 : users:((“memosameh”,2174,65))
LISTEN 0 128 *:30017 : users:((“memosameh”,2174,42))
LISTEN 0 128 *:8001 : users:((“memovips”,2179,27))
LISTEN 0 128 *:12066 : users:((“memoexcha”,2177,86))
LISTEN 0 128 *:12034 : users:((“memoexcha”,2177,54))
LISTEN 0 128 *:30050 : users:((“memosameh”,2174,76))
LISTEN 0 128 *:30018 : users:((“memosameh”,2174,43))
LISTEN 0 128 *:8002 : users:((“memovips”,2179,28))
LISTEN 0 128 *:12067 : users:((“memoexcha”,2177,87))
LISTEN 0 128 *:12035 : users:((“memoexcha”,2177,55))
LISTEN 0 128 *:12003 : users:((“memoexcha”,2177,24))
LISTEN 0 128 *:30051 : users:((“memosameh”,2174,77))
LISTEN 0 128 *:30019 :

Please can you give an example of a specific port not working?

all ports not work except port 80 it works fine

but when i stopped the upstream in the host all ports are work!!!

What is the upstream?

nginx application for streaming works in the host

this topic you replay

And that you dont have a firewall running on the host (or upstream in the network) that is blocking access to port 80 on the host’s IP. :slight_smile:

@darknite1979 can you do curl http://<host ip> on the host, does it return the container’s page?

Also, can you do curl http://127.0.0.1 inside the container?