LinuxQuestions.org
Review your favorite Linux distribution.
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 10-19-2012, 08:54 AM   #1
sunveer
Member
 
Registered: Jul 2012
Posts: 139

Rep: Reputation: Disabled
Routing Problem


Again not getting things to work. Need you help..

I have setup two different machines (PC and a Laptop) and one KVM in each machine.

Setup is like this >>

Server A
Code:
IP: 172.24.0.254
Gateway: 172.24.0.254
Server A has a virtual machine Virtual A (Isolated Network not bridge or NAT)
Virtual A
Code:
IP: 10.4.0.4
Gateway: 10.4.0.4
Server B
Code:
IP: 172.24.0.3
Gateway: 172.24.0.3
Server B has a virtual machine Virtual B (Isolated Network not bridge or NAT)
Virtual B
Code:
IP: 10.3.0.3
Gateway: 10.3.0.3
I have disabled Firewall on all ServerA,B and VirtualA,B to try initial setup and checked using
Code:
iptables -L
to see if disabled

I have set
Code:
net.ipv4.ip_forward = 1
I can ping Server A from Server B and Server B from Server A as they are on same network.
Server A can ping Virtual A and Virtual A can ping Server A as I have setup route to Server A in Virtual A because Virtual A has isolated network.

Similarly, Server B can ping Virtual B and Virtual B can ping Server B.

Now my final motive is to ping Virtual B from Server A.

As per the concept I have setup a route on Server A as follows:

Code:
ip route add 10.3.0.0/24 via 172.24.0.3
Code:
[root@server network-scripts]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.24.0.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
10.4.0.0        0.0.0.0         255.255.255.0   U     0      0        0 virbr0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
10.3.0.0        172.24.0.3      255.255.255.0   UG    0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
0.0.0.0         172.24.0.254    0.0.0.0         UG    0      0        0 eth0
As per this I must be able to ping Virtual B from Server A, however pinging 10.3.0.3 from Server A doesn't show any reply.

Code:
[root@server network-scripts]# ping 10.3.0.3
PING 10.3.0.3 (10.3.0.3) 56(84) bytes of data.
^C
--- 10.3.0.3 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5981ms

[root@server network-scripts]#
However, I can ping 10.3.0.1 from Server A.

Please help me to achieve the motive.

Last edited by sunveer; 10-23-2012 at 06:22 AM.
 
Old 10-19-2012, 02:39 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
Is VM of virtual B same as virtual A? The different VM may use different way to routing traffic between virtual machine and physical machine.
 
Old 10-20-2012, 02:27 AM   #3
sunveer
Member
 
Registered: Jul 2012
Posts: 139

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by nini09 View Post
Is VM of virtual B same as virtual A? The different VM may use different way to routing traffic between virtual machine and physical machine.
Both have same KVM.
 
Old 10-20-2012, 08:22 AM   #4
hamlindsza
Member
 
Registered: Aug 2012
Distribution: Debian, CentOS
Posts: 74

Rep: Reputation: Disabled
Hi Sunveer,

You will need to change your Virtual Machine's (Virtual A & B) Network Adapter settings to Bridge mode. And then check on Server A & Server B if a route to corresponding VM networks are present.
 
Old 10-20-2012, 08:30 AM   #5
sunveer
Member
 
Registered: Jul 2012
Posts: 139

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hamlindsza View Post
Hi Sunveer,

You will need to change your Virtual Machine's (Virtual A & B) Network Adapter settings to Bridge mode. And then check on Server A & Server B if a route to corresponding VM networks are present.
But if I will set kvm's network to bridge mode then they will not have different network but will have IP of server A or server B in the range 172.24.0.0 and not in separate ranges.
 
Old 10-22-2012, 02:26 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
If virtual machine B is same as virtual machine A, it should be working on virtual machine B. Maybe you should configure networking mode of virtual machine B to bridge at first to make sure virtual machine is Ok.
By the way, what mode do you use for your setup?
 
Old 10-23-2012, 06:27 AM   #7
sunveer
Member
 
Registered: Jul 2012
Posts: 139

Original Poster
Rep: Reputation: Disabled
Problem is Solved.

on Virtual Machines gateway must be

Code:
10.3.0.1
Code:
10.4.0.1
 
  


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
Routing problem? or ppp connection problem? onim1978 Linux - Networking 1 09-09-2010 09:06 AM
Dynamic routing isn't done; static routing works for about 2 seconds for wireless gregorian Linux - Networking 7 02-19-2010 06:43 AM
routing problem newbie_adm Linux - Newbie 3 08-26-2006 06:30 PM
routing problem durak Linux - Networking 1 11-14-2005 02:20 AM
routing problem freelinuxcpp Linux - Networking 4 03-20-2004 07:50 AM

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

All times are GMT -5. The time now is 04:21 AM.

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