Host only w Virtualbox

Tutaj można zadać pytanie, jeśli Linuksa widzi się pierwszy raz w życiu ;)
krzy07
Piegowaty Guziec
Piegowaty Guziec
Posty: 11
Rejestracja: 11 sty 2009, 16:25
Płeć: Mężczyzna
Wersja Ubuntu: 12.04
Środowisko graficzne: Unity
Architektura: x86

Host only w Virtualbox

Post autor: krzy07 »

Cześć.
Na temat sieci w Virtualbox jest w internecie dużo, ale i tak nie mogę sobie poradzić.

Host: Ubuntu 12.04.2 + Virtualbox 4.2.8

Guest: Ubuntu 12.04.2 + ssh

Adapter 1: NAT
Adapter 2: Host-only 'vboxnet0'

Wynik ifconfig eth1 dla Gościa jest w załączniku.

Przy próbie połączenia z Hosta dostaje wynik:

Kod: Zaznacz cały

krzy@Ubuntu_12_04:~$ ssh 192.168.56.102
ssh: connect to host 192.168.56.102 port 22: Connection timed out
krzy@Ubuntu_12_04:~$



Wynik iptables:

Kod: Zaznacz cały

krzy@Ubuntu_12_04:~$ sudo iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     tcp  --  localhost            anywhere             tcpflags:! FIN,SYN,RST,ACK/SYN
ACCEPT     udp  --  localhost            anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     icmp --  anywhere             anywhere             limit: avg 10/sec burst 5
DROP       all  --  anywhere             255.255.255.255     
DROP       all  --  anywhere             192.168.0.255       
DROP       all  --  base-address.mcast.net/8  anywhere            
DROP       all  --  anywhere             base-address.mcast.net/8 
DROP       all  --  255.255.255.255      anywhere            
DROP       all  --  anywhere             0.0.0.0             
DROP       all  --  anywhere             anywhere             state INVALID
LSI        all  -f  anywhere             anywhere             limit: avg 10/min burst 5
INBOUND    all  --  anywhere             anywhere            
LOG_FILTER  all  --  anywhere             anywhere            
LOG        all  --  anywhere             anywhere             LOG level info prefix "Unknown Input"

Chain FORWARD (policy DROP)
target     prot opt source               destination         
ACCEPT     icmp --  anywhere             anywhere             limit: avg 10/sec burst 5
LOG_FILTER  all  --  anywhere             anywhere            
LOG        all  --  anywhere             anywhere             LOG level info prefix "Unknown Forward"

Chain OUTPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     tcp  --  192.168.0.14         localhost            tcp dpt:domain
ACCEPT     udp  --  192.168.0.14         localhost            udp dpt:domain
ACCEPT     all  --  anywhere             anywhere            
DROP       all  --  base-address.mcast.net/8  anywhere            
DROP       all  --  anywhere             base-address.mcast.net/8 
DROP       all  --  255.255.255.255      anywhere            
DROP       all  --  anywhere             0.0.0.0             
DROP       all  --  anywhere             anywhere             state INVALID
OUTBOUND   all  --  anywhere             anywhere            
LOG_FILTER  all  --  anywhere             anywhere            
LOG        all  --  anywhere             anywhere             LOG level info prefix "Unknown Output"

Chain INBOUND (1 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere             state RELATED,ESTABLISHED
LSI        all  --  anywhere             anywhere            

Chain LOG_FILTER (5 references)
target     prot opt source               destination         

Chain LSI (2 references)
target     prot opt source               destination         
LOG_FILTER  all  --  anywhere             anywhere            
LOG        tcp  --  anywhere             anywhere             tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5 LOG level info prefix "Inbound "
DROP       tcp  --  anywhere             anywhere             tcpflags: FIN,SYN,RST,ACK/SYN
LOG        tcp  --  anywhere             anywhere             tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5 LOG level info prefix "Inbound "
DROP       tcp  --  anywhere             anywhere             tcpflags: FIN,SYN,RST,ACK/RST
LOG        icmp --  anywhere             anywhere             icmp echo-request limit: avg 1/sec burst 5 LOG level info prefix "Inbound "
DROP       icmp --  anywhere             anywhere             icmp echo-request
LOG        all  --  anywhere             anywhere             limit: avg 5/sec burst 5 LOG level info prefix "Inbound "
DROP       all  --  anywhere             anywhere            

Chain LSO (4 references)
target     prot opt source               destination         
LOG_FILTER  all  --  anywhere             anywhere            
LOG        all  --  anywhere             anywhere             limit: avg 5/sec burst 5 LOG level info prefix "Outbound "
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable

Chain OUTBOUND (1 references)
target     prot opt source               destination         
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere             state RELATED,ESTABLISHED
LSO        all  --  anywhere             tower.goodlike.pl   
LSO        all  --  anywhere             ns358527.ovh.net    
LSO        all  --  anywhere             ks39174.kimsufi.com 
LSO        all  --  anywhere             ns3271937.ovh.net   
ACCEPT     all  --  anywhere             anywhere 

W Virtualbox kartę vboxnet0 mam z włączonym DHCP.
W Gościu w /etc/network/interfaces mam eth0 i eth1 ustawione na auto.

Od czego zacząć sprawdzać, żeby ssh zaczęło działać???

krzy

//bear7: Polecenia, wyniki poleceń, zawartość plików systemowych oraz konfiguracyjnych na forum umieszczaj pomiędzy znacznikami CODE.
Załączniki
ekran_goscia.png
Zrzut ekranu
(31.71 KiB) Nie pobierany
frytek
Wytworny Kaczor
Wytworny Kaczor
Posty: 330
Rejestracja: 06 sty 2006, 00:03
Płeć: Mężczyzna
Wersja Ubuntu: 10.04
Środowisko graficzne: GNOME
Architektura: x86
Kontakt:

Re: Host only w Virtualbox

Post autor: frytek »

Jeśli ci nie przeszkadza, że gość będzie widoczny w twojej sieci lokalnej, to użyj karty w trybie bridge. Gość dostanie adres z twojego routera i bez problemu będzie widoczny w sieci (z hosta, oczywiście, też).

Ewentualny dostęp z innych maszyn niż z hosta zablokuj na gościu firewallem i tyle. :)
ODPOWIEDZ

Wróć do „Przedszkole Linuksa”

Kto jest online

Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 12 gości