Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
541 views
in Technique[技术] by (71.8m points)

linux - How to open some ports on Ubuntu?

I know little about Linux.Today I create a VPN server on My ubuntu according to https://github.com/philplckthun/setup-simple-ipsec-l2tp-vpn But when I finish the installation. I use my iphone to connect the ipsect vpn,bur it shows the VPN Server has no response.

The github document shows

Ports 1701, 500 and 4500 must be opened for the VPN to work!

So I have tried to open these ports on my ubuntu server. I use "iptables" command to open these ports.but it failed.Maybe I don't known how to use this command correctly。So I want to know how can I open this ports on my ubuntu server? And if this ports have been opened successfully, can it be proved by the windows cmd window through telnet the port?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Ubuntu these days comes with ufw - Uncomplicated Firewall. ufw is an easy-to-use method of handling iptables rules.

Try using this command to allow a port

sudo ufw allow 1701

To test connectivity, you could try shutting down the VPN software (freeing up the ports) and using netcat to listen, like this:

nc -l 1701

Then use telnet from your Windows host and see what shows up on your Ubuntu terminal. This can be repeated for each port you'd like to test.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...