LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Unable to ping my server after turning off one network card (https://www.linuxquestions.org/questions/linux-networking-3/unable-to-ping-my-server-after-turning-off-one-network-card-4175736721/)

LardFr0g 05-04-2024 10:07 PM

Unable to ping my server after turning off one network card
 
I have a problem i must solve where there are two virtual machines set to host only on vmware.
The first is running ubuntu with an ip address of 192.168.152.129
The second is running kali linux with two network cards, eth0 which has an ip of 192.168.152.128 and eth1 which has an ip of 192.168.228.128. i can ping from one machine to the other just fine but for the question i have to input these commands in the kali terminal.
sudo ifconfig eth0 down
sudo ifconfig eth1 192.168.150.129 netmask 255.255.255.0
sudo route add default gw 192.168.150.242 eth1

now the ping wont work and i need to understand how to fix it without turning on eth0.
what i have tried so far is setting eth1 to 192.168.152.130 and giving it a route of 192.168.152.1.
but pinging it still doesnt work and so i tried many solutions but found out that when i do arp -a, eth1 doesnt have 192.168.152.129 in its address and it is only listed as unknown.
Any solution would be greatly appreciated.

business_kid 05-05-2024 10:40 AM

Hello, LardFr0g & welcome to LQ.

What you have given us is about ¼ of the story. Give us the rest:
  • You say you're in a VM with two nics. Are they connected via nat? Are the Nics owned by two OSes?
  • How does your routing table look?
  • How does your /etc/hosts look?
  • If you're using NAT, what is the host going to make of those ping requests?
  • What is the exact error reported (check both ways).
  • Who set you this problem? To be preciser, are you askling us to do your homework/project work?
A network lecturer I respected would not look at a network question unless the student had drawn it out. Half the time, doing that made the solution obvious to the student. Just a thought.

nini09 05-09-2024 02:44 PM

Does the Ubuntu VM use eth0?

business_kid 05-10-2024 04:24 AM

Another thing worth knowing. dhcp clients add a default route, because they think there. So if you're connecting both with dhcp, the first will see nothing. You're going to have to get back with information.


All times are GMT -5. The time now is 02:40 PM.