1829103 Members
4882 Online
109986 Solutions
New Discussion

IP Problem

 
Samarth
Advisor

IP Problem

Hi all,

I have three network cards on my Linux box:

eth0:192.168.141.30
255.255.255.0
eth1 192.168.142.30
255.255.255.0
eth2:150.1.130
255.0.0.0


192.168.141.x series can access 192.168.142.x series and vice-versa.

But I am not able to ping PC's on 150.1.1.x series network.

Is it because of IP address class prob?

I need help badly.
8 REPLIES 8
Paul_503
New Member

Re: IP Problem

Hi

I don't think it's so much the IP class than it is the fact that you'll notice the two 192.126.*.* networks are on the same netmask. If you want to be able to ping the 150.*.*.* network, you'll have to pass through a router, and as you have the 150.*.*.* plugged into a nic on your PC, your PC will have to become a router. If you need help, let me know and I'll try my best.
HGN
Honored Contributor

Re: IP Problem

Hi

The eth0 and eth2 are in two different network and if you have to ping or reach the network you need a gateway defined which has to e provided by your network team(eth0 network will have a gateway) and thro that gateway router you will be able to reach eth2.
Check what is the entry in /etc/sysconfig/network there should be a line GATEWAY=x.x.x.x
Try and ping that Gateway IP if you are able to ping that IP then there is some issue on the router side which needs to be fixed by your network team

Hope this helps

Rgds

HGN
Paul_503
New Member

Re: IP Problem

I'm just wondering, in reply to the last response. If he has three NICs, one connects the 192.168.141 network, the other the 192.168.142 network, and the last the 150.1.1 network, doesn't his Linux system then has to serve as the gateway.

If I understand correctly, a system with 2 or more NICs is normally a router. I can't see how or why he'd have to go via another router.

Samarth, why does the system have three nics in the first place?? Was it supposed to serve as a gateway?
Samarth
Advisor

Re: IP Problem

Hi All,

Thnx for your replies.

I want to make this linux box as router.
I want all the network traffic to pass through this box.

My office is divided into three networks.

What command or default Gateway I should mention in order to access 150.1.1.x series network.

I have mentioned the IP adderss of my DSL router as default gateway in order to allow 192.168.142..x series PC's access internet which is 192.168.142.201.

Waiting for Prompt reply..

Thnx

Samarth
Manuel Wolfshant
Trusted Contributor

Re: IP Problem

I assume there is a typo in your first message, and that the third NIC has 150.1.1.30 as IP address. As a side note, are you sure that the correct netmask is 255.0.0.0 ? Please check the mask as it is set on other boxes in the same network. I assume that most probably the mask is 255.255.255.0, as the others.
If I am correct I think that what happens that, due to a mismatch in the settings, other boxes might try to answer to the original ARP REQUEST but the replies do not reach your router.

Anyway, for further investigation, I suggest running tcpdump -i eth2 -n in one terminal, while doing an arping 150.1.something.valid in another terminal. You should see arp requests originating from your router and arp replies from the other computer. IF all goes well, go on testing using icmp (ping 150.1.something.valid). You should see a succesion of ICMP echo requests and replies.
However if at the first step you see only ARP requests (and absolutely no other traffic), that could mean a defective NI, cable, switch port. If you see traffic bot no ARP replies to your requests, most probably there is a mismatch in the network settings.
Jeroen Peereboom
Honored Contributor

Re: IP Problem

Indeed,

you have three networks:
192.168.141.0 - 192.168.141.255
192.168.142.0 - 192.168.142.255
150.0.0.0 - 150.255.255.255
I assume a typo too for the eth2 entry (150.1.1.30). Are you really sure the netmask is 255.0.0.0 for the last one? I assume 255.255.255.0, giving a network of 150.1.1.0 - 150.1.1.255.

From this Linux box:
can you ping a PC / server in 192.168.141.x?
can you ping a PC / server in 192.168.142.x?
can you ping a PC / server in 150.1.1.x?

If so, your Linux box has basic connectivity to all networks.

You Linux box seems to act as a router already: 192.168.141.x can reach 192.168.142.x and viceversa.

Do the PC's and servers on 150.1.1.0 have this Linux box 150.1.1.30 defined as gateway for 192.168.141.0 and 192.168.142.0?

JP.

(You assigned points to 0 out of 20 replies.... Check http://forums1.itrc.hp.com/service/forums/helptips.do?#28)
xyko_1
Esteemed Contributor

Re: IP Problem

Hi Samarth,

complementing Jerome's reply if you are pinging all lans from the server and you are not pinging across the server (gateway), and your server is correctly defined as the default gateway to the lan, then you have to verify if you are allowing ip forwarding. i.e., that the server permits a ip package to traverse the server from one subnet to the others.

#cat /proc/sys/net/ipv4/ip_forward must show 1 as the response.

If not you must set
net.ipv4.ip_forward = 1
on /etc/sysctl.conf
and
#sysctl -p
to apply the change.

Regards,
Xyko
Johannes Krackowizer_1
Valued Contributor

Re: IP Problem

hi samarth,

first you have to know that a subnet mask 255.255.255.0 means that the first 3 numbers mark the network so i'm wondering why 192.168.141.x and 192.168.142.x computer should see each other while 150.x.x.x computers can't see anything else then their own network.

please check if all clients have the correct subnetmask (for all 192.168.141.x and 192.168.142.x 255.255.255.0 and for all 150.x.x.x 255.0.0.0) and check if all have the correct gateway settings (fo all 192.168.141.x 192.168.141.30, for all 192.168.142.x 192.168.142.30 and for all 150.x.x.x 150.1.1.30).

and you have to enable routing on your linux box on redhat you can use the graphical interface to do this or type:

echo 1 > /proc/sys/net/ipv4/ip_forward

but this command enables routing only until you reboot or restart networking with init scripts.

best regards,

johannes
"First off, I'd suggest printing out a copy of the GNU coding standards, and NOT read it. Burn them, it's a great symbolic gesture." (Linus Torvalds)