LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Routing between subnets in a Linux virtual machine (https://www.linuxquestions.org/questions/linux-newbie-8/routing-between-subnets-in-a-linux-virtual-machine-4175472140/)

Ninja2k 08-05-2013 04:30 AM

Routing between subnets in a Linux virtual machine
 
I have two Debian Linux Virtual Machines with two virtual adapters each, both adapters are on separate subnets. I need two subnets to test security tools

Subnet 1 - 192.168.50.x
Subnet 2 - 192.168.70.x

I need the two subnets to be able to communicate with each other but I have only very basic Linux.

Is it possible to route the information between the two subnets preferable without an external router?

codeguy 08-05-2013 12:36 PM

Ahh.. I think you can set your netmask to 255.255.0.0 (on both interfaces), and you should be just fine.

TimothyEBaldwin 08-05-2013 01:39 PM

Edit /etc/sysctl.conf to turn on routing on reboot.
Code:

sysctl -w net.ipv4.ip_forward=1
Will do so immediately.

Ninja2k 08-05-2013 02:13 PM

Quote:

Originally Posted by TimothyEBaldwin (Post 5003486)
Edit /etc/sysctl.conf to turn on routing on reboot.
Code:

sysctl -w net.ipv4.ip_forward=1
Will do so immediately.

That works really nicely, thanks for that. Much appreciated.


All times are GMT -5. The time now is 02:42 AM.