LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-30-2006, 04:56 AM   #1
dsids
Member
 
Registered: Mar 2006
Distribution: FC4
Posts: 184

Rep: Reputation: 31
problems connecting to a lan from another subnet


Hi,
My office has ip range from 192.168.10. Two days back I was told to install a couple of servers so I attached two network cards to a pc.

( Server 1)

eth0 - 192.168.10.235 ( connected to my office lan running dhcp )

eth1 - 172.22.1.1 ( statically assinged the ip )

Then I installed another server ( Server 2 )and gave it the ip 172.22.1.2.

Now Im able to ping from:

172.22.1.2 to 172.22.1.1
172.22.1.2 to 192.168.10.235

But Im not able to go beyond 192.168.10.235 from 172.22.1.2. I also cannot access any service from Server2 on Server1, for eg ssh

Im able to ping Server2 from Server1 and am also able to access any service on Server2

Please Advise

Thanks
Danish
 
Old 08-30-2006, 06:13 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Any of these problems could be caused by the firewall (iptables) rules on server 1. If they are not too long, perhaps you would like to post these?


The inability to ping the 192.168.10.0/24 subnet could, in addition, be caused by server 1 not being set to forward packets (in which case the 192.168.10.0/24 clients couldn't get out to the 17.22 addresses either) or by the routing table in server 1 not containing a route to the 192.168.10.0/24 subnet. Perhaps you want to publish the routing table also?

Check for forwarding with:

Code:
sysctl -a 2> /dev/null | grep forward
 
Old 08-30-2006, 06:32 AM   #3
nuxrl
Member
 
Registered: Jun 2006
Location: NY, USA
Distribution: Slackware, Arch
Posts: 176

Rep: Reputation: 35
Quote:
Originally Posted by dsids
Now Im able to ping from:

172.22.1.2 to 172.22.1.1
172.22.1.2 to 192.168.10.235
Are you able or not able to ping 192.168.10.235 from 172.22.1.2?

If you have not configured routing on server 1, a simple solution is to change the servers to listen on 172.22.1.1. For example, ssh, change /etc/ssh/sshd_config to have
Code:
ListenAddress 172.22.1.1
and restart sshd should do it.

Last edited by nuxrl; 08-30-2006 at 06:43 AM.
 
Old 08-30-2006, 06:50 AM   #4
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
nuxrl,

I just about injured myself laughing at your sig!
 
Old 08-30-2006, 07:07 AM   #5
dsids
Member
 
Registered: Mar 2006
Distribution: FC4
Posts: 184

Original Poster
Rep: Reputation: 31
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 172.22.1.2 0.0.0.0 UG 0 0 0 eth1

# sysctl -a 2> /dev/null | grep forward
net.ipv6.conf.eth1.forwarding = 0
net.ipv6.conf.lo.forwarding = 0
net.ipv6.conf.eth0.forwarding = 0
net.ipv6.conf.default.forwarding = 0
net.ipv6.conf.all.forwarding = 0
net.ipv4.conf.eth1.mc_forwarding = 0
net.ipv4.conf.eth1.forwarding = 0
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.lo.forwarding = 0
net.ipv4.conf.eth0.mc_forwarding = 0
net.ipv4.conf.eth0.forwarding = 0
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.default.forwarding = 0
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.all.forwarding = 0
net.ipv4.ip_forward = 0


Quote:
Are you able or not able to ping 192.168.10.235 from 172.22.1.2?
Yes Im able to ping 192.168.10.235 from 172.22.1.2


Thanks
Danish
 
Old 08-30-2006, 07:16 AM   #6
dsids
Member
 
Registered: Mar 2006
Distribution: FC4
Posts: 184

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by dsids
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 172.22.1.2 0.0.0.0 UG 0 0 0 eth1

# sysctl -a 2> /dev/null | grep forward
net.ipv6.conf.eth1.forwarding = 0
net.ipv6.conf.lo.forwarding = 0
net.ipv6.conf.eth0.forwarding = 0
net.ipv6.conf.default.forwarding = 0
net.ipv6.conf.all.forwarding = 0
net.ipv4.conf.eth1.mc_forwarding = 0
net.ipv4.conf.eth1.forwarding = 0
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.lo.forwarding = 0
net.ipv4.conf.eth0.mc_forwarding = 0
net.ipv4.conf.eth0.forwarding = 0
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.default.forwarding = 0
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.all.forwarding = 0
net.ipv4.ip_forward = 0




Yes Im able to ping 192.168.10.235 from 172.22.1.2


Thanks
Danish
Also I switched off the iptables on Server1. I ran the above route command and the sysctl command on Server1

This is the routing table on 172.22.1.2 ( Server2 )
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.22.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 172.22.1.1 0.0.0.0 UG 0 0 0 eth0
 
Old 08-30-2006, 09:31 AM   #7
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
I am not sure why you can't access your services on server 1. If you wan't to be able to ping (or do anything else) between the two subnets, you are going to have to turn on ip forwarding. One way is to add the line

Code:
net.ipv4.ip_forward = 1
to /etc/sysctl.conf and run:

sysctl -p

as root.

EDIT: I just noticed that you have the default gateway on both servers 1 and 2 set to the other server. I think the kernel can actually detect and break this infinite loop type routing, but it is still probably not a good idea.

Last edited by blackhole54; 08-30-2006 at 09:47 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
routing pptp tunnel subnet to local lan 0xception Linux - Networking 1 07-11-2006 03:26 PM
Connecting another LAN is impossible? odd-geir Linux - Networking 7 07-27-2005 06:03 PM
connecting to a lan with amigo mjdx88 Slackware 1 07-09-2004 12:34 AM
DHCP Subnet Problems Hunza Linux - Networking 14 06-14-2004 03:38 AM
Need help connecting to LAN HoosTrax Linux - Networking 1 02-06-2004 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration