3

I have a machine C with two NICs, namely eth0 and eth1, with CentOS 4.9 installed on it. Also I have a machine A connecting to C through eth0 and a machine B connecting to C through eth1. Now I want machine A to be in a subnet (e.g. 192.168.3.0/24) and machine B to be in another subnet (e.g. 192.168.4.0/24) and they could communicate with each other.

                  eth0         eth1
Machine A <---------> Machine C <---------> Machine B
           ...3.0/24             ...4.0/24

According to the answer of my previous question about this problem, I configured my eth0 and eth1:

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.3.1
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet

/etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.4.1
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet

And configure Machine A (Windows XP) with 192.168.3.10, 192.168.3.1(gw), and Machine B (windows 7) with 192.168.4.10, 192.168.4.1(gw). I have enabled ip forwarding on machine C. Now, I haven't added any routes or iptables rules. I could ping 192.168.3.10 from machine B, but not vice vesa. Am i missing some routing rules? If yes, how to add these rules?

Any suggestions or tutorials or howtos will be appreciated.

1
  • Good question, well done.
    – womble
    Aug 3, 2011 at 9:20

2 Answers 2

1

A quick test:

Control Panel -> Windows Firewall (under System and Security, if you do that sort of thing). In the left pane, click 'Turn Windows Firewall On/Off', then turn off the Firewall in the right pane.

If you can ping it then, great... you can turn it back on, and allow ping by using the directions at http://www.sysprobs.com/enable-ping-reply-windows-7.

If that doesn't work, another quick test would be to shutdown iptables, just for troubleshooting purposes, of course. Even if you don't remember messing with it, it's worth testing...

sudo /etc/init.d/iptables stop
1
  • Thanks very much. The problem is exactly what you've said. Great thanks to you. Aug 3, 2011 at 10:56
1

The fact that one machine can successfully ping the other machine suggests that the router machine (C) is configured at least reasonably correctly -- IP forwarding works, and there's no default "reject" policy in the iptables configuration.

I'd be inclined to suspect a firewall setting on Machine B that makes it not respond to pings by default. I'm not Microsoft guru, though, so I don't know if that might be a default Windows 7 thing, or how to go about checking and fixing it, but presumably there's some config manager in there somewhere you can click around in.

If that doesn't seem to be bearing fruit, just make a sanity check on your iptables config by running iptables -L -n and making sure there are no rules in the FORWARD chain (some system config thing might have added them) and that the policy for that chain is, in fact, ACCEPT (this isn't good security practice, but we're not as far as "making it secure" yet, just "making it work"). If you're not confident interpreting the output, paste the output into your question and someone will give you the thumbs up.

2
  • Thanks, womble. You're so kind and patient to help me out. Aug 3, 2011 at 10:58
  • Upvotes (and accepted answers) are appreciated in return.
    – womble
    Aug 3, 2011 at 11:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .