Ping failing «Destination Host Unreachable»
I am trying to set up a static IP address for my Debian virtual machines. In my /etc/networking/interfaces file I added:
iface ens33 inet static address 192.168.75.XXX gateway 192.168.0.1 netmask 255.255.255.0
In the /etc/resolv.conf file I have added nameserver 8.8.8.8 . I believe my issue is that unless I have the NetworkManager service enabled nothing shows up when I run route or ip route show . I tried adding a route to the routing table by running the following command: ip route add 192.168.75.0/24 via 192.168.75.XXX (my static ip) dev ens33 . This populates the routing table and the table now looks like:
Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.75.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
do you have an internal router to route between .75.x and .0.x? your default gateway really should be an address on the IP network the the interface is on, or you need a route to reach it. if you don’t have a router, those two IPs can’t talk unless you open up the mask to 255.255.0.0 and treat all 192.168.x.y addresses as a single network. also, why are you trying to add a route for the local network? that is generally auto-detected. be more concerned about how to get from .75.x to .0.x.
So I have changed the gateway to be on the same ip network. I’ve changed it to 192.168.75.1 but also tried 192.168.75.0 but I still get the same results. Could this have to do with the Network configuration of the VM. I forgot to mention these are Virtual machines. I’ve tried the NAT and bridged connection but so far no change
do you have a router with an interface assigned the address 192.168.75.1, and an interface on 192.168.0.0/24? you can’t just put in an address, it has to be an address on a router, with a pathway between both networks. If you don’t have a router, just put your VMs in the 192.168.0.0/24 network. Personally I recommend using Bridged network connections unless you really want to get into the nitty-gritty of virtual networking, but you could make it work either way.
Hey thank you for all your help. I changed the network to ‘bridged ‘ and i am now able to ping successfully. Thanks again for all your help.
2 Answers 2
In /etc/networking/interfaces , in each section, you set a netmask that defines the subnet your machine belongs to. Here: 255.255.255.0 means /24. IOW, the adresses on your subnet go from 192.168.75.1 to 192.168.75.254.
The gateway line specifies the address of the router that must be used to reach a machine that is outside that subnet. Obviously, the router must be a machine that is on the same subnet, i.e. that has an IP address between 192.168.75.1 to 192.168.75.254.
You have specified gateway 192.168.0.1 . That means that the router is outside the subnet. That’s why you cannot ping any machine outside your sub-network 192.168.75.0/24 («Destination Host Unreachable»).
You are using VMs. Your router is probably the IP address of your host. It depends on the configuration of your VM.
ip route add 192.168.75.0/24 via 192.168.75.XXX (my static ip) dev ens33
is wrong. If you want to declare a router manually (as opposed to the interfaces file) then use this command:
ip route add default via 192.168.75.YYY (the IP of your router) dev ens33
(default means «any address that has no known route»)
Destination host unreachable is a common ICMP error message when the ping packets from your machine could not find the destination machine.
It looks like some settings on your machine are blocking the ping packets from discovering the route to the destination IP.
Well, I see you fixed the problem by changing the network type to bridge mode. So I think I better write a general answer since your issue is solved.
The common reason to get the ping reply Destination Host Unreachable is due to the overprotective settings on the firewall. Unless you are running a bridging firewall, a simple misconfiguration can block proper ping packet working.
You can verify it by disabling the firewall and ping the destination IP again.
The second common reason is a loose network connection. Referred from this source.
We can fix this, by disconnecting both power cables and Ethernet cables from the modem, router, and PC. Reconnect them again and power on the devices. It is called power cycling.
«Destination Host Unreachable» and ssh » No route to host»
На центосе стоит 2 сетевые карты с этими айпи. И нету подключения к интернету.
При попытке пинга с Убунты локальной машины центос пишет
Чего? Ты с локальной машины с убунтой пингуешь сам себя и тебе отвечает центос?
Я с Убунты(192.168.8.101) пытаюсь пинговать центос(192.168.100.166 и 192.168.8.1) На центосе установлены 2 сетевые карты с такими айпи. К 166 подключен кабель от глобальной сетки, а со второй карты идет кабель в роутер и от роутера второй кабель идет в убунту.
Не судите, но тут думаю есть проблема.
route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.8.0 0.0.0.0 255.255.255.0 U 100 0 0 enp2s1 192.168.8.1 192.168.100.166 255.255.255.255 UGH 0 0 0 enp2s5 192.168.8.101 192.168.100.166 255.255.255.255 UGH 0 0 0 enp2s5 192.168.100.0 0.0.0.0 255.255.255.0 U 100 0 0 enp2s5 192.168.100.166 192.168.100.254 255.255.255.255 UGH 0 0 0 enp2s5
Ну так у Вас просто сеть не работает.
Начинать надо сначала — приведите список и параметры сетевых интерфейсов на локальной машине (команда ifconfig), а также таблицу маршрутизации (команда ip route).
Ну и проверьте, есть ли сеть физически (в логах dmesg должны быть строчки, что сетевые интерфейсы подняты).
Это с какой машины таблица маршрутизации?
ifconfig enp2s5 Link encap:Ethernet HWaddr 00:16:e6:66:3d:f2 inet addr:192.168.8.101 Bcast:192.168.8.255 Mask:255.255.255.0 inet6 addr: fe80::9d31:3207:5516:4f24/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:21420 errors:0 dropped:1 overruns:0 frame:0 TX packets:12467 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:8616229 (8.6 MB) TX bytes:1984494 (1.9 MB) Interrupt:21 lo Link encap:Локальная петля (Loopback) inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:2153 errors:0 dropped:0 overruns:0 frame:0 TX packets:2153 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:300690 (300.6 KB) TX bytes:300690 (300.6 KB) ip route default via 192.168.8.1 dev enp2s5 proto static metric 100 169.254.0.0/16 dev enp2s5 scope link metric 1000 192.168.8.0/24 dev enp2s5 proto kernel scope link src 192.168.8.101 metric 100
ifconfig enp2s1: flags=4163 mtu 1500 inet 192.168.8.1 netmask 255.255.255.0 broadcast 192.168.8.255 ether 00:1e:58:2b:f3:d8 txqueuelen 1000 (Ethernet) RX packets 10877 bytes 1691073 (1.6 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 35 bytes 3226 (3.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp2s5: flags=4163 mtu 1500 inet 192.168.100.166 netmask 255.255.255.0 broadcast 192.168.100.255 inet6 fe80::216:e6ff:fe66:3830 prefixlen 64 scopeid 0x20 ether 00:16:e6:66:38:30 txqueuelen 1000 (Ethernet) RX packets 21222 bytes 3227539 (3.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 7336 bytes 1019089 (995.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 21 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 8204 bytes 1397066 (1.3 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 8204 bytes 1397066 (1.3 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ip route 192.168.8.0/24 dev enp2s1 proto kernel scope link src 192.168.8.1 metric 100 192.168.8.1 via 192.168.100.166 dev enp2s5 scope link 192.168.8.101 via 192.168.100.166 dev enp2s5 scope link 192.168.100.0/24 dev enp2s5 proto kernel scope link src 192.168.100.166 metric 100 192.168.100.166 via 192.168.100.254 dev enp2s5
MAC eth0
Hi people!
Вопрос: После смены мак адреса (kali виртуалка) пропадает связь (Destination Host Unreachable).Хотя на самом хосте после подмены все работает. VirtBox в режиме bridge.Связь хоста с дом.роутером по вафле.Фильтраций мак нетю.
0v3r_Cr1t
Hi people!
Вопрос: После смены мак адреса (kali виртуалка) пропадает связь (Destination Host Unreachable).Хотя на самом хосте после подмены все работает. VirtBox в режиме bridge.Связь хоста с дом.роутером по вафле.Фильтраций мак нетю.
russian404
macchanger-ом в crontab-е заданием — @reboot macchanger -r eth0 в virtualbox-е в kali В настройках самого virtualbox-а не менял
gushmazuko
Ты меняешь mac адрес но IP остается тот же, поэтому сервер dhcp отвечает некорректно.
Попробуй так:
ifconfig eth0 down
ifconfig eth0 0.0.0.0
ifconfig eth0 up
dhclient eth0
russian404
Ты меняешь mac адрес но IP остается тот же, поэтому сервер dhcp отвечает некорректно.
Попробуй так:
ifconfig eth0 down
ifconfig eth0 0.0.0.0
ifconfig eth0 up
dhclient eth0
не проканало
[email protected]:~# ifconfig eth0 down
[email protected]:~# ifconfig eth0 0.0.0.0
[email protected]:~# macchanger -r eth0
Current MAC: 62:e4:74:9b:6d:97 (unknown)
Permanent MAC: 08:00:27:18:59:0b (CADMUS COMPUTER SYSTEMS)
New MAC: 32:d0:a6:7f:7b:ae (unknown)
[email protected]:~# ifconfig eth0 up
[email protected]:~# dhclient eth0
[email protected]:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.1.31 icmp_seq=1 Destination Host Unreachable
From 192.168.1.31 icmp_seq=2 Destination Host Unreachable
From 192.168.1.31 icmp_seq=3 Destination Host Unreachable
From 192.168.1.31 icmp_seq=4 Destination Host Unreachable
From 192.168.1.31 icmp_seq=5 Destination Host Unreachable
From 192.168.1.31 icmp_seq=6 Destination Host Unreachable
^C
— 8.8.8.8 ping statistics —
7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6121ms
pipe 4
RPi 3 SSH error- Destination host unreachable on Kali Linux
I got my Raspberry Pi 3 Model B shipped recently. As I don’t have any HDMI display, I ran to my neighbor’s house to test my Pi. I used the memory card provided with the kit which had NOOBS preinstalled. I installed Raspbian and it worked like a charm. Back at my house, I was trying to use my laptop’s screen as display for my Pi and I came across a tutorial here- https://pihw.wordpress.com/guides/direct-network-connection/comment-page-4/#comment-7373 In the tutorial it’s told to edit the cmdline.txt file in the Boot section and add a line ip= and save it as cmdline.direct, then copy the original file and save as cmdline.normal, and then swap between the files. So I made the required edit and swapped the cmdline.direct with cmdline.txt (yes I did change the name), and I made the changes in Kali, as in Windows you can’t really see the boot partition when using NOOBS. When I connected it to my lappy running Kali and tried ssh @169.254.0.2 I got an error saying that Destination Host is unreachable. When I try to ping the ip I get the same error. I tried it on my Windows laptop with puTTY. All I got was a blank console screen which gave the very same error after a while. What am I doing wrong? I really need to get my Pi working on my laptop. Both My Windows and Kali PCs are set to obtain IP’s automatically. Any help will be greatly appreciated. Thanks. EDIT: I solved the problem for puTTY on Windows. I went to my neighbor’s house and used his TV as HDMI output for my Pi and followed the tutorial, this time using the steps that were for when you have an HDMI output. The first step was to run the hostname -I command which wasn’t supposed to return anything, but in my case, returned an IP address. I immediately tried pinging that IP from my Windows PC and I could ping it. I then tried puTTY which gave me access to the Pi’s terminal. Seems like the Pi is intelligent enough to assign itself a static IP. However I can still neither ping the same IP from Kali nor connect to it. Any idea why?