Closed daiaji closed 3 years ago
Could you try it as root?
Even if you use sudo su
to switch to the root user to run podman, the result is the same.
Does this container image work with Docker?
You should first try with --privileged and see if it works then.
Does this container image work with Docker?
You should first try with --privileged and see if it works then.
docker
# v2ray -c /etc/v2ray/config.json
V2Ray 4.34.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.15.6 linux/amd64)
A unified platform for anti-censorship.
2021/01/12 14:32:54 [Info] v2ray.com/core/main/jsonem: Reading config: /etc/v2ray/config.json
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/log: Logger started
2021/01/12 14:32:54 [Info] v2ray.com/core/app/dns: DNS: created Local DOH client for https://223.5.5.5/dns-query
2021/01/12 14:32:54 [Info] v2ray.com/core/app/dns: DNS: created Remote DOH client for https://1.1.1.1/dns-query
2021/01/12 14:32:54 [Info] v2ray.com/core/app/dns: DNS: created localhost client
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/stats: create new counter inbound>>>inbound_API>>>traffic>>>uplink
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/stats: create new counter inbound>>>inbound_API>>>traffic>>>downlink
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/proxyman/inbound: creating stream worker on 127.0.0.1:15490
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/stats: create new counter inbound>>>tproxy_IN_ipv4lo>>>traffic>>>uplink
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/stats: create new counter inbound>>>tproxy_IN_ipv4lo>>>traffic>>>downlink
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/proxyman/inbound: creating stream worker on 127.0.0.1:12345
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/stats: create new counter inbound>>>tproxy_IN_ipv6lo>>>traffic>>>uplink
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/stats: create new counter inbound>>>tproxy_IN_ipv6lo>>>traffic>>>downlink
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/proxyman/inbound: creating stream worker on [::1]:12345
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/stats: create new counter inbound>>>http_IN>>>traffic>>>uplink
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/stats: create new counter inbound>>>http_IN>>>traffic>>>downlink
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/proxyman/inbound: creating stream worker on 127.0.0.1:8888
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/stats: create new counter inbound>>>socks_IN>>>traffic>>>uplink
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/stats: create new counter inbound>>>socks_IN>>>traffic>>>downlink
2021/01/12 14:32:54 [Debug] v2ray.com/core/app/proxyman/inbound: creating stream worker on 0.0.0.0:1080
2021/01/12 14:32:54 [Info] v2ray.com/core/transport/internet/tcp: listening TCP on 127.0.0.1:15490
2021/01/12 14:32:54 [Info] v2ray.com/core/transport/internet/tcp: listening TCP on 127.0.0.1:12345
2021/01/12 14:32:54 [Info] v2ray.com/core/transport/internet/udp: listening UDP on 127.0.0.1:12345
2021/01/12 14:32:54 [Info] v2ray.com/core/transport/internet/tcp: listening TCP on [::1]:12345
2021/01/12 14:32:54 [Info] v2ray.com/core/transport/internet/udp: listening UDP on [::1]:12345
2021/01/12 14:32:54 [Info] v2ray.com/core/transport/internet/tcp: listening TCP on 127.0.0.1:8888
2021/01/12 14:32:54 [Info] v2ray.com/core/transport/internet/tcp: listening TCP on 0.0.0.0:1080
2021/01/12 14:32:54 [Info] v2ray.com/core/transport/internet/udp: listening UDP on 0.0.0.0:1080
2021/01/12 14:32:54 [Warning] v2ray.com/core: V2Ray 4.34.0 started
There doesn't seem to be a permission issue. Although cgproxy does not seem to work properly in the end. (Maybe because iptables is not working properly).
I used the --privileged parameter for podman, and the lack of permission error stopped. But cgproxy still does not work, and iptables does not seem to be effective.
After that, I tried to start /sbin/init, but when systemd started, all this still did not improve. To be honest, I even tried to run all this in lxc, but it was still useless (although I actually run in lxc manjaro). Will iptables really work for me in a container environment?
Not sure what TPROXY is doing, but could you try with the host network.
--net=host
Not sure what TPROXY is doing, but could you try with the host network.
--net=host
https://www.kernel.org/doc/Documentation/networking/tproxy.txt It looks like this, but can iptables really work in a container?
They can work within a --privileged container, but I believe you want them on the host network, not buried on a VPN. Since this is not a podman issue, I am going to close.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description When I use v2ray in archlinux container, I found that TPROXY cannot be used. And Iptables doesn't seem to work either.
Steps to reproduce the issue:
1.
podman run -it archlinux bash
2.Install v2ray and cgproxy.
3.Follow this link to configure v2ray and cgproxy, and run v2ray and cgproxy.(This link provides the configuration of v2ray.)
4.
cgproxy curl -vI https://www.google.com
Describe the results you received:
In addition, because I don’t know why I can’t use systemctl to start v2ray, I typed /usr/bin/v2ray -c /etc/v2ray/config.json in the terminal to run v2ray, and I got these errors.
Running with sudo seems to be the same...
Since v2ray doesn't seem to work properly, cgproxy can't work for me either.
Describe the results you expected:
v2ray and cgproxy can work for me.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
physical