LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Routing Red Hat VM through local physical box. (https://www.linuxquestions.org/questions/linux-networking-3/routing-red-hat-vm-through-local-physical-box-883712/)

geelsu 05-31-2011 08:02 AM

Routing Red Hat VM through local physical box.
 
I've setup an XP VM using Red Hat's KVM. The physical Red Hat box has two NICs, a fiber one in use and active and a CAT-5 one that is disabled and with no wire connected.

The physical box has br0 active and bridging on the subnet of 192.168.10.0/24. ip route show also displays for virbr0 192.168.0.0/16

My physical box (192.168.10.228)can ping the virbr0 IP of 192.168.122.1, but not the XP VM of 192.168.122.228

I have played around with Window's route command to try and setup some method for the Windows VM to ping the 192.168.10.0 network, but have not had any luck. I've also messed around with the Red Hat netmask and such to work it from the Linux side. But then, as would be expected, I can't talk to other Linux boxes on the physical network.

Does anyone have any ideas how to get the Windows box to communicate with the Red Hat box and the other Linux systems beyond while keeping the two distinct networks of 192.168.10.0 and 192.168.122.0 leaving them both as Class C (255.255.255.0)?

I mentioned the unused CAT-5 NIC thinking perhaps it could operate as an internal router even with no cable attached. That was just a random thought and I have not even explored that.

Thanks everyone for reading and especially for your thoughts and expertise.

T3RM1NVT0R 05-31-2011 01:01 PM

@ Reply
 
Hi there,

Try this add the following route on your RedHat machine: route add -net 192.168.122.0 255.255.255.0 gw 192.168.122.1

Also let us know the following information:

1. Virtual box solution in use. Like VMware or Virtual Box
2. What type of ethernet configuration is in use on host machine (XP) whether bridged or NAT or host only etc.

geelsu 06-01-2011 06:40 AM

Hi T3RM1NVT0R

I actually had some contact with Red Hat and my barking-up the 192.128.122.0 tree seems to be a dead end perhaps. Here is their statement:

"The virbr0 IP address is completely unrelated to the IP address of the guest operating systems. You should simply be able to set the IP address as you wish. Bridges act like virtual ethernet switches, rather than as routers."

So it seems I've been trying to route via "switches." I guess I would need some sort of software based routing RPM so that systems attached to the 192.168.10.0 network and the 192.168.122.0 network could be routed to each other.

In his statement above he says "...You should simply be able to set the IP address as you wish..." and that is true. I can set the VM IP to one on the 192.168.10.0 network and it is happy. I can ping other systems.

I've also played around with your route command using all sorts of combinations of the parameters and their variables, but haven't hit on any success yet.

I had hoped to try and trick the VM by setting the IP to something like 192.168.122.2 and then use a netmask of 255.255.0.0 so the network portion of the IP would match (well sort of match), but this did not work.

Oh well, it seems I have two machines, one physical and one virtual. Either I put them on the same subnet and move on or I find a virtual router. I seen rumors that squid might do this, but I haven't found any good examples of setting that up. All the examples and forums point squid to being more useful as a proxy for web stuff and such.

If I get something figured out, I'll let you know.

Thanks


All times are GMT -5. The time now is 05:23 AM.