Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

没有端口监听 #1

Closed
gexqin opened this issue Feb 29, 2020 · 8 comments
Closed

没有端口监听 #1

gexqin opened this issue Feb 29, 2020 · 8 comments

Comments

@gexqin
Copy link

gexqin commented Feb 29, 2020

systemctl status nat
● nat.service - 动态设置nat规则
Loaded: loaded (/lib/systemd/system/nat.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2020-02-29 09:30:32 UTC; 23s ago
Process: 9454 ExecStart=/usr/local/bin/nat /etc/nat.conf (code=exited, status=101)
Main PID: 9454 (code=exited, status=101)

程序看起来是运行的,但是指定需要转发的端口并没有处于监听状态(运行 netstat -nap 命令查询)。 目前我的TCP转发主要靠HAPROXY实现,但UDP转发是一个难点。不知是否我对这个程序的理解有哪里不对?希望作者解答。(Ubuntu 18.0.4LTS,无iptable,无fairwalld,无selinux)

@arloor
Copy link
Owner

arloor commented Feb 29, 2020

跟haproxy不一样,这个应用设置的是内核层的东西,所以没有应用监听端口。

@gexqin
Copy link
Author

gexqin commented Feb 29, 2020

Yes,找到问题了,之前运行后不工作我以为是端口问题,现在发现我没有安装nftables。 这个文档需要加一句啊。准备工作里没有写要装nftables啊,我以为自动的
准备工作
关闭firewalld
关闭selinux
开启内核端口转发

@arloor
Copy link
Owner

arloor commented Feb 29, 2020

好的,已经添加说明

@arloor
Copy link
Owner

arloor commented Feb 29, 2020

你使用的是什么系统啊,按道理centos8是默认会安装nftables的

@arloor arloor closed this as completed Feb 29, 2020
@arloor arloor reopened this Feb 29, 2020
@gexqin
Copy link
Author

gexqin commented Feb 29, 2020

Ubuntu 18.0.4LTS

你使用的是什么系统啊,按道理centos8是默认会安装nftables的

Azure Ubuntu 18.0.4 LTS

@gexqin gexqin closed this as completed Feb 29, 2020
@gexqin
Copy link
Author

gexqin commented Feb 29, 2020

Ubuntu 18.0.4LTS

你使用的是什么系统啊,按道理centos8是默认会安装nftables的

Azure Ubuntu 18.0.4 LTS

多说一句。Ubuntu 18.0.4 LTS里安装好 nftables之后 也不会自动创建 /etc/nftables/ 目录,一样会导致程序运行但不可用,看看之后的版本能不能做一个检测 nftables有没有安装和 /etc/nftables/ 目录是否存在的功能哈。

@arloor
Copy link
Owner

arloor commented Feb 29, 2020

不加了,因为已经说明了仅适用于centos8

@houpi
Copy link

houpi commented Aug 19, 2021

我在centos7里了试了也不行。。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants