Author Topic: Routing Issues?  (Read 757 times)

Ben

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 185
  • Know Thyself
    • View Profile
Routing Issues?
« on: April 20, 2018, 04:41:49 pm »
I have a small problem with routing... maybe.... maybe not.

I have two machines; one is my work machine with one NIC and the other is a server/gateway with two NICS; one connecting to the work machine and the other NIC which has IJFirewall and connects to a modem which has the Internet line.

The work machine has the IP address 192.168.0.1 and the server has 192.168.0.2 for the LAN and 192.168.2.9 for the line to the modem.
The modem's IP address is 192.168.2.1

I have had this setup working fine for years. But there is one nagging problem; I cannot CMD ping *.*.2.1 from the work machine nor any other outside address either using the domain name or the IP address for a destination.

Now get this; PMPing has no problem pinging anywhere -inside or outside- on the work machine. The cmd ping will work fine for anything on the LAN, just not outside.

The server has no issues pinging anything in anyway or to anywhere.

I am not sure that it is relevant in this case, but the following is the setup.cmd for the work machine, and after that, for the server;

Code: [Select]
inetcfg -s all
route -fh
arp -f
ifconfig lo 127.0.0.1
ifconfig lan0 192.168.0.1 netmask 255.255.255.0 metric 0 mtu 1500
REM ifconfig lan0
REM ifconfig lan1
REM ifconfig lan2
REM ifconfig lan3
REM ifconfig lan4
REM ifconfig lan5
REM ifconfig lan6
REM ifconfig lan7
REM ifconfig sl0
route add default 192.168.0.2 -hopcount 0
route add net 192.168 192.168.0.2 -hopcount 0
ipgate off

Server setup.cmd:

Code: [Select]
inetcfg -s all
route -fh
arp -f
ifconfig lo 127.0.0.1
ifconfig lan0 192.168.2.9 netmask 255.255.255.0 metric 0 mtu 1500
ifconfig lan1 192.168.0.2 netmask 255.255.255.0 mtu 1500
REM ifconfig lan2 metric 1 mtu 1500
REM ifconfig lan3 metric 1 mtu 1500
REM ifconfig lan4 metric 1 mtu 1500
REM ifconfig lan5 metric 1 mtu 1500
REM ifconfig lan6 metric 1 mtu 1500
REM ifconfig lan7 metric 1 mtu 1500
REM ifconfig sl0
route add default 192.168.2.1 -hopcount 0
route add -net 192.168 192.168.2.1 -hopcount 0
ipgate on

Simple enough, yet not so simple.



David McKenna

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 10
  • Posts: 219
    • View Profile
Re: Routing Issues?
« Reply #1 on: April 20, 2018, 10:35:55 pm »
Ben,
 
 The 'route add net' doesn't look right on the work machine - shouldn't it be 'route add -net'?

Regards

Ben

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 185
  • Know Thyself
    • View Profile
Re: Routing Issues?
« Reply #2 on: April 20, 2018, 10:42:07 pm »
If I recall correctly the "-" is a carry over from an earlier version and if I'm not mistaken it works either way with the newer versions.

There's something similar with hopcount too I believe. I could check into it for the details, but that fact that it works at all means it must be accepting the parameters.

I'll look into it just to be clear.

Andreas Schnellbacher

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 24
  • Posts: 437
    • View Profile
Re: Routing Issues?
« Reply #3 on: April 20, 2018, 11:13:54 pm »
If I recall correctly the "-" is a carry over from an earlier version and if I'm not mistaken it works either way with the newer versions.
You don't need 'route add net' or 'route add -net'. 'route add default' suffices for your home network.

BTW: IIRC, the version with '-net' is the newer one. For the 'hopcount' parameter: I have there the number 1 instead of 0. You can also remove that together with the 'metric' parameter of ifconfig. See 'start view TCPCR.HLP route' and 'start view TCPCR.HLP hopcount' for the syntax.
« Last Edit: April 20, 2018, 11:31:07 pm by Andreas Schnellbacher »