Score:0

Routing two debian virtual machines on one network

in flag

I have two debian virtual machines on two different physical servers with 2 interfaces on each virtual machines. One port of each vm is connected to each other on a network with CIDR of /21. and there is one sip trunk network connected to 1st vm through a physical cable on interface ens224 (since int ens192 is connected with vm2).

The network of sip has an ip with cidr of /30 ( which gives us 2 ip to use ) which is connected to vm physically.

what i am stuck is the routing of VM 2 towards sip trunk network ip.

When i defined ip route towards sip trunk from vm2, the interface ip of that sip trunk is reachable but the second ip of subnet 255.255.255.252 is not reachable which is towards the sip trunk.

Score:0
it flag

if I understand correctly you need VM1 to act as a router because this VM is able to reach the sip trunk and also VM2. VM2 is able to reach sip IP of VM1 but not the second sip IP on that /30 subnet..

On VM1 - first of all make sure your iptables FORWARD policy is set to accept and that Kernel IP forwarding is enabled :

# sysctl -w net.ipv4.ip_forward=1

if you have a static IP route set on VM2 you should be able to reach sip IP by now:

ip route add 10.0.5.0/30 via 10.1.2.3 dev ens224

where 10.1.2.3 is IP of VM1

xchan4 avatar
in flag
Yes the scenario is same as you guessed, and i have also applied the Forward rule in VM1 which is connected to SIP trunk. But hard to find any luck. From VM2 i can ping the sip trunk ip which is at the VM1's end. but not the ip of the same subnet which is at SIP trunk's end.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.