I have a network with 2 linux computers:
________________ ____________ ____________
| INTERNETROUTER |---| COMPUTER 1 |---| COMPUTER 2 |
---------------- ------------ ------------
Both computers runs SuSE 8.2 (2.4 kernel).
Computer 1 & computer 2 are connected using a crossover cable.
I want to configure computer 1 to masquerade the internet connection
of computer 2, but it doesn't work. The connection between computer 1
and computer 2 just does nothing, not even a ping.
The network cards are a Realtek RTL-8029 (eth0 of computer 1, does
internet),
a VIA VT6102 (integrated on mobo) and a 3com 3CCFE575CT (pcmcia).
The ip address of eth1@pc1 is 172.31.01. The ip address of computer 2
is 172.31.0.2. I tried with 2 different crossover cables, but both
does not work. The LED on eth1 and the 3com network adapter are on.
More detailed information:
Machine 1:
$ echo 1>/proc/sys/net/ipv4/ip_forward
$ echo 1>/proc/sys/net/ipv4/conf/eth1/forwarding
$ echo 0>/proc/sys/net/ipv4/conf/eth0/forwarding
$ /etc/rc.d/SuSEfirewall2_init start
Starting Firewall Initialization (phase 1 of 3)
$ /etc/rc.d/SuSEfirewall2_setup start
Starting Firewall Initialization (phase 2 of 3)
Warning: interface vmnet1 is not (yet?) active.
$ /etc/rc.d/SuSEfirewall2_final start
Starting Firewall Initialization (phase 3 of 3)
Warning: interface vmnet1 is not (yet?) active.
$ route add 172.31.0.2 gw 172.31.0.1 eth1
lsmod (part of):
Module Size Used by Tainted: PF
ipv6 145108 -1 (autoclean)
ipt_TCPMSS 2392 1 (autoclean)
ipt_LOG 3384 2 (autoclean)
ipt_TOS 1048 18 (autoclean)
ipt_MASQUERADE 1368 1 (autoclean)
ipt_state 568 71 (autoclean)
ipt_REJECT 3160 3 (autoclean)
iptable_mangle 2200 1 (autoclean)
iptable_filter 1708 1 (autoclean)
ip_nat_ftp 2960 0 (unused)
iptable_nat 16366 2 [ipt_MASQUERADE ip_nat_ftp]
ip_conntrack_ftp 3888 1
ip_conntrack 16964 3 [ipt_MASQUERADE ipt_state ip_nat_ftp
iptable_nat ip_conntrack_ftp]
ip_tables 11200 11 [ipt_TCPMSS ipt_LOG ipt_TOS ipt_MASQUERADE
ipt_state ipt_REJECT iptable_mangle iptable_filter iptable_nat]
via-rhine 12912 1
mii 2528 0 [via-rhine]
ifconfig:
eth0 Link encap:Ethernet HWaddr 00:50:BF:68:07:B6
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::250:bfff:fe68:7b6/64 Scope:Link
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6312 errors:0 dropped:0 overruns:0 frame:0
TX packets:5704 errors:0 dropped:0 overruns:0 carrier:0
collisions:436 txqueuelen:100
RX bytes:4133931 (3.9 Mb) TX bytes:653552 (638.2 Kb)
Interrupt:10 Base address:0xb800
eth1 Link encap:Ethernet HWaddr 00:0C:6E:6D:03:36
inet addr:172.31.0.1 Bcast:172.31.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:6eff:fe6d:336/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:55 errors:0 dropped:0 overruns:0 frame:0
TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:4646 (4.5 Kb) TX bytes:3666 (3.5 Kb)
Interrupt:9 Base address:0xa000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:70 errors:0 dropped:0 overruns:0 frame:0
TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4564 (4.4 Kb) TX bytes:4564 (4.4 Kb)
route -n:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.31.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
Machine 2:
ipconfig of eth0 (ipv4)
Link encap:Ethernet
HWaddr 00:01:03:03:7C

C:5F
inet addr: 172.31.0.2 bcast 172.31.0.255 mask 255.255.255.0
up broadcast running multicast mtu:1500 metric:1
rx packets:1 errors:0 dropped:0 overruns:0 frame:0
tx packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
rx bytes:60 (60.b) tx bytes: 912 (912.0 b)
interrupt: 10 base addres:0x4000
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
172.31.0.1 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 172.31.0.1 0.0.0.0 UG 0 0 0 eth0