LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to connect to FTP (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-connect-to-ftp-4175454303/)

sunveer 03-16-2013 07:04 AM

Unable to connect to FTP
 
I have a physical machine and virtual machine which is using NAT.

IP for physical : 172.24.0.254
IP for virtual: 10.254.0.2

I have setup vsftpd server on virtual machine and opened ports 20,21 on virtual machine in iptables using:

Code:

iptables -I INPUT -s 172.24.0.0/24 -p tcp -m multiport --dport 20,21 -j ACCEPT
iptables -I INPUT -s 172.24.0.0/24 -p udp -m multiport --dport 20,21 -j ACCEPT

But physical machine is unable to connect to ftp. It says.
ftp> no route to host

However, when I use the commands

Code:

iptables -I INPUT -p tcp -m multiport --dport 20,21 -j ACCEPT
iptables -I INPUT  -p udp -m multiport --dport 20,21 -j ACCEPT

it works.

I want to know why is it not accepting a particular source address range.

spazticclown 03-16-2013 08:01 AM

Does it work if you use 10.254.0.0/(I assume 24 for your network) instead of 172.24.0.0/24?

The virtual machine probably sees the incoming address as 10.254.0.1 (assuming that is the virtual gateway address for the NAT virtual network).

I just tested this on my virtual server (using ssh, tcp port 22) and it works for me using the NAT virtual network address.

sunveer 03-16-2013 08:20 AM

Quote:

Originally Posted by spazticclown (Post 4912821)
Does it work if you use 10.254.0.0/(I assume 24 for your network) instead of 172.24.0.0/24?

The virtual machine probably sees the incoming address as 10.254.0.1 (assuming that is the virtual gateway address for the NAT virtual network).

I just tested this on my virtual server (using ssh, tcp port 22) and it works for me using the NAT virtual network address.

Thanks for clearing me. It worked as you told.


All times are GMT -5. The time now is 06:52 PM.