LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-04-2024, 10:07 PM   #1
LardFr0g
LQ Newbie
 
Registered: May 2024
Posts: 1

Rep: Reputation: 0
Question 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.

Last edited by LardFr0g; 05-05-2024 at 12:39 AM.
 
Old 05-05-2024, 10:40 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,398

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
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.

Last edited by business_kid; 05-05-2024 at 10:43 AM.
 
Old 05-09-2024, 02:44 PM   #3
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,855

Rep: Reputation: 161Reputation: 161
Does the Ubuntu VM use eth0?
 
Old 05-10-2024, 04:24 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,398

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
wifi keeps getting turned off and not finding any network, or not working and not turning off in any way. gets fixed after i reboot. AFKmoein Linux - Wireless Networking 0 09-03-2022 10:47 PM
Display not turning off when using xrandr --output <display> --off. Instead it just turns black. bluesk Linux - Newbie 5 07-18-2020 10:24 AM
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 02:39 PM
I cannot ping with command 'ping IP' address but can ping with 'ping IP -I eth0' sanketmlad Linux - Networking 2 07-15-2011 05:32 AM
network card needs to be restarted after turning router off and on JacekZ Linux - Networking 2 09-06-2005 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration