Since you are only trying to connect the two computers 198.168.1.1 and
198.168.1.2, you don't need the gateways you have set up.
Your routing tables do not seem correct to me.
1. Remove all routing entries in both machines except for the
127.0.0.0 entries.
2. on 198.168.1.1 type
route add -host 198.168.1.2 dev eth0
3. on 198.168.1.2 type
route add -host 198.168.1.1 dev eth0
That should do it. If not, try a new cross-over cable.
Once you get this working, simply put the two route lines above at the
end of
/etc/rc.d/rc.local
-sen
>
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use
> Iface
> 192.168.1.1 0.0.0.0 255.255.255.255 UH 0 0 0
> eth0
> 192.168.1.2 192.168.1.1 255.255.255.255 UGH 0 0 0
> eth0
> 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0
> eth0
> 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0
> lo
>
> Removing by hand the first two routes, nothing changes.
>
> ################################################################################
> >>>ifconfig
> eth0 Link encap:Ethernet HWaddr 00:C0:26:CE:18:AC
> inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
> UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> TX packets:0 errors:25 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:100
> Interrupt:5 Base address:0x220
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> UP LOOPBACK RUNNING MTU:3924 Metric:1
> RX packets:204 errors:0 dropped:0 overruns:0 frame:0
> TX packets:204 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
>
>
> ################################################################################
>
> >>>route -n
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use
> Iface
> 192.168.1.2 0.0.0.0 255.255.255.255 UH 0 0 0
> eth0
> 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0
> eth0
> 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0
> lo
>
> removing first route by hand nothing changes
>
>
> >>>ifconfig
> eth0 Link encap:Ethernet HWaddr 00:E0:98:1A:11:D3
> inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
> UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
> RX packets:48 errors:0 dropped:0 overruns:0 frame:0
> TX packets:266 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:100
> Interrupt:11 Base address:0x340
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> UP LOOPBACK RUNNING MTU:3924 Metric:1
> RX packets:120 errors:0 dropped:0 overruns:0 frame:0
> TX packets:120 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
>
>