[SOLVED] IPtables : ssh port forwarding one port to another port issue
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If the FORWARD policy in the filter table is set to DROP, you will need a rule allowing SSH traffic from anywhere to 192.168.122.150:22 (the FORWARD chain sees the NATed packet).
Also, make sure IP forwarding (routing) is enabled.
I have a task and I need help here with iptables please.
Task says: VM1 can be accessed via SSH from subnet 10.1.0.0/22 on 10.1.0.1:2222. I am running 5 virtual machines here , all are ubuntu server 16.04 I have ubuntu server (router) with two different networks: Network A = 10.10.1.0./26 and Network B = 10.1.0.1/22
In Network A i have two clients: VM1 with IP: 10.10.1.20/26 (static address) and VM2 with IP: 10.10.1.30/26 (static address) Network B has 2 clients also: VM3 with IP: 10.1.0.100/22 (DHCP Reserved) and VM4 with IP: 10.1.1.100/22 (DHCP Reserved)
Router@ubuntu-server interfaces:
enp0s3 inet addr:10.10.1.1 Bcast:10.10.1.63 Mask:255.255.255.192 (this is inteface for lan subnet 10.10.1.0/26)
enp0s8 inet addr:10.1.0.1 Bcast:10.1.3.255 Mask:255.255.252.0 (this is interface for lan subnet 10.1.0.1/22)
enp0s9 inet addr:192.168.110.229 Bcast:192.168.110.255 Mask:255.255.255.0 (this is bridged adapter to my host computer and have internet access)
Please advise.
You need to read the LQ Rules and "Question Guidelines". You re-opened a thread that had been closed for FIVE YEARS, to hijack it with your own question. Neither is good. You need to open your own thread for your own question.
Also, this sounds *VERY* much like a homework question. Why don't you show us what you've done/tried so far, when you open your own thread?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.