Głowię się i głowię ostatnio nad powodem dlaczego nie mogę odpowiednio uruchomić konta FTP na maszynie zwirtualizowanej.
Problem mój jak domyślam się polega na tym, że port 20 jest zarezerwowany dla maszyny matki na którym zwirtualizowany system jest.
Port 20 wedle mojej informacji w trybie aktywnym służy do przesyłania danych.
Tryb pasywny... Cóż nie bardzo działa.
Domyślam się, że dokupienie u providera dodatkowego ip i przekierowanie całego ruchu pytającego o te ip na maszynę zwirtualizowaną (ubuntu 9.10) by rozwiązało problem.
Moje pytanie brzmi. Czy mogę przekierować na maszynie zwirtualizowanej port 20 lokalnie tak by najpierw wysyłał dane na port 1020 a następnie dopiero na maszynę matkę (Dom0), która dalej przesyła dane do klienta?
Ewentualnie prosiłbym o jakieś przemyślenia wasze, które mogą w sposób inny rozwiązać ten problem. Tak sobie myślę, że wymaga to myślenia niestandardowego.
Maszyna matka ma ip. 123:123:123:123 (tutaj taki żarcik oczywiście
Maszyna wewnętrzna ma ip 192.168.122.12
Aktualnie próbowałem konfiguracji poprzez tryb pasywny. Wedle tego co znalazłem w google uruchomiłem serwer pasywnie i wybrałem mu zakres portów pomiędzy 3810 a 3820 do połączenia pasywnego.
Przekierowałem każdy port amatorsko w ten sposób:
[root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3810 -j DNAT --to-destination 192.168.122.12:3810 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3811 -j DNAT --to-destination 192.168.122.12:3811 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3812 -j DNAT --to-destination 192.168.122.12:3812 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3813 -j DNAT --to-destination 192.168.122.12:3813 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3814 -j DNAT --to-destination 192.168.122.12:3814 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3815 -j DNAT --to-destination 192.168.122.12:3815 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3816 -j DNAT --to-destination 192.168.122.12:3816 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3817 -j DNAT --to-destination 192.168.122.12:3817 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3818 -j DNAT --to-destination 192.168.122.12:3818 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3819 -j DNAT --to-destination 192.168.122.12:3819 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol tcp --destination-por t 3820 -j DNAT --to-destination 192.168.122.12:3820 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3820 -j DNAT --to-destination 192.168.122.12:3820 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3819 -j DNAT --to-destination 192.168.122.12:3819 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3818 -j DNAT --to-destination 192.168.122.12:3818 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3817 -j DNAT --to-destination 192.168.122.12:3817 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3816 -j DNAT --to-destination 192.168.122.12:3816 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3815 -j DNAT --to-destination 192.168.122.12:3815 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3814 -j DNAT --to-destination 192.168.122.12:3814 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3813 -j DNAT --to-destination 192.168.122.12:3813 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3812 -j DNAT --to-destination 192.168.122.12:3812 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3811 -j DNAT --to-destination 192.168.122.12:3811 [root@zulu239 ~]# iptables -t nat -I PREROUTING --protocol udp --destination-por t 3810 -j DNAT --to-destination 192.168.122.12:3810
Natomiast najnowszą konfigurację vsftp możecie znaleźć tutaj:
http://pastebin.com/Pf4spu5a
Szczególnie moją uwagę przykuły opcje, których normalnie w domyślnej konfiguracji nie ma. Mianowicie:
- pasv_max_port=3810
- pasv_min_port=3820
- tcp_wrappers=YES
- pasv_promiscuous=YES













