R
R
romajke2019-04-27 14:15:34
Computer networks
romajke, 2019-04-27 14:15:34

Where might the routing error be?

So there is Oracle VM VirtualBox . It has 2 virtual machines installed:
Win XP with two network adapters:

  1. Host-only adapter. Name: vboxnet0
  2. internal network. Name: my lan

In win xp , the following LAN connections are configured:
  1. Host-only Adapter - 192.168.1.1/24
  2. Internal Network - 192.168.2.1/24

Win Server 2003 with one network adapter:
  1. internal network. Name: my lan

The win server is configured to connect to the Internal Network - 192.168.2.10/24. Default Gateway: 192.168.2.1
This is all running on a physical Linux Mint machine.
This physical machine on the vboxnet0 network has the following settings:
vboxnet0  Link encap:Ethernet  HWaddr 0a:00:27:00:00:00  
              inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:489 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:69301 (69.3 KB)

The task is to set up routing on a computer with Windows XP .
On a machine with Win Xp , I prescribe the following routes:
route add 192.168.2.0 mask 255.255.255.0 192.168.2.1
    route add 192.168.1.0 mask 255.255.255.0 192.168.1.1

This is how the result of the route command looks like on a virtual machine with win xp.
n9HCI.png
On a physical machine, I write the following route:
route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.1.0

This is what the result of the route command looks like on a physical machine:
Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    default         dir-300         0.0.0.0         UG    100    0        0 enp2s0
    link-local      *               255.255.0.0     U     1000   0        0 enp2s0
    172.17.0.0      *               255.255.0.0     U     0      0        0 docker0
    172.18.0.0      *               255.255.0.0     U     0      0        0 br-2ca568140112
    192.168.0.0     *               255.255.255.0   U     100    0        0 enp2s0
    192.168.1.0     *               255.255.255.0   U     0      0        0 vboxnet0
    192.168.2.0     192.168.1.1     255.255.255.0   UG    0      0        0 vboxnet0

From the virtual machine used as a router (Win XP) I can ping both subnets (both the physical computer with ip 192.168.1.10 and the virtual machine with IP 192.168.2.10 ping successfully).
The problem is that the addresses 192.168.2.1 and 192.168.1.1 are pinged from the physical machine, but the address 192.168.2.10 is not :(
I also tried to create a separate routing table on the physical machine (table name rt2) and set the following settings:
ip route add default via 192.168.1.1 table rt2
ip route add 192.168.1.0/24 dev vboxnet src 192.168.1.10 table rt2
ip rule add from 192.168.1.10/32 table rt2
ip rule add to 192.178.1.10/32 table rt2
ip rule add to 192.168.2.0/24 table rt2

ip route show table rt2 command output
default via 192.168.1.1 dev vboxnet0 
192.168.1.0 dev vboxnet0  scope link  src 192.168.1.10 
192.168.2.0 via 192.168.1.1 dev vboxnet0

The output of the ip rule command
0:	from all lookup local 
32759:	from all to 192.168.2.0/24 lookup rt2 
32760:	from 192.168.1.10 lookup rt2 
32761:	from all to 192.168.1.10 lookup rt2 
32766:	from all lookup main 
32767:	from all lookup default

And again the same problem, from the physical machine the addresses 192.168.2.1 and 192.168.1.1 are pinged, but the address 192.168.2.10 is not there :(
Tell me, what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Vasiliev, 2019-04-27
@romajke

1. Windows XP does not route anything by default, this must be enabled. Article from Microsoft for windows 2003 https://support.microsoft.com/ru-ru/help/323339/ho... for XP everything is the same.

Locate and click the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Set the following registry values:
Value Name: IPEnableRouter
Value type: REG_DWORD
Value Data: 1
NOTE: A value of 1 turns on (enables) TCP/IP forwarding for all network connections installed and used by this computer.

2. Actions, at least superfluous, this should already be in the routing table as for connected interfaces. These are connected networks and should not be resolved through a gateway, but through media access.
route add 192.168.2.0 mask 255.255.255.0 192.168.2.1
route add 192.168.1.0 mask 255.255.255.0 192.168.1.1

3. Here is probably a typo
Need gw 192.168.1.1
PS Windows is not my forte, from the point of view of routing (settings) you have everything right.

R
Ruslan Fedoseev, 2019-04-27
@martin74ua

Wrong you are doing what you are trying to do from the desktop system router)
microsin.net/adminstuff/windows/xp-routing.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question