LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-14-2009, 09:36 AM   #1
Franxez
LQ Newbie
 
Registered: Feb 2009
Posts: 19

Rep: Reputation: 0
routing problem on centos 5.2


im going nuts....

need help. please read
Lan 192.168.50.0/24 /-------Pc2
(internet)>----ServerCentos----<switch>----Pc1 gw is the server
192.168.50.98 \-------Pc3

ok thats my lan i need to do this..

Centos y conected to a vpn which priv ip is 192.168.100.0
the thing is centos can conncet and ping host on the 192.168.100.0
i need 192.168.50.0 to ping 192.168.100.0
i enable ip forwarding
check ip tables
and check my estatic routes, but still cant route pack.

why?
 
Old 10-14-2009, 10:52 PM   #2
Smartpatrol
Member
 
Registered: Sep 2009
Posts: 196

Rep: Reputation: 38
uh..netmask 255.255.0.0? what do i win?
 
Old 10-15-2009, 12:09 AM   #3
mohona
LQ Newbie
 
Registered: Mar 2006
Location: KOlKATA,W.B,INDIA.
Distribution: REDHAT
Posts: 1

Rep: Reputation: 0
Provide me the output of the following commands from your centos box:-

ifconfig
netstat -nr
sysctl -p

Thanks,
Mohona.
 
Old 10-15-2009, 05:03 AM   #4
pvs
Member
 
Registered: Jan 2005
Location: Lviv, Ukraine
Distribution: Something self-made
Posts: 69

Rep: Reputation: 16
you cannot ping anything, because the machine from 192.168.100.0 subnet simply does not "knows" where to send answers.

the simplest way when you're administrator only in subnet 192.168.50.0 is to do address translation
iptables -t nat -A POSTROUTUNG -d 192.168.100.0/24 -j SNAT --to-source 192.168.100.X
192.168.100.X - corresponding ip-address of your CentOS router

the other way (when you'ra administrator in 192.168.100.0 too): to make your CentOS default router or on your default router create static route to subnet 192.168.50.0/24 using gateway 192.168.100.X

third way is to specify route to subnet 192.168.50.0 via 192.168.100.X on each machine in subnet 192.168.100.0 (manually or via DHCP)
 
Old 10-15-2009, 09:52 AM   #5
Franxez
LQ Newbie
 
Registered: Feb 2009
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mohona View Post
Provide me the output of the following commands from your centos box:-

ifconfig
netstat -nr
sysctl -p

Thanks,
Mohona.
in response

eth1 Link encap:Ethernet HWaddr 00:A0:C97:1AE
inet addr:192.168.50.98 Bcast:192.168.50.255 Mask:255.255.255.0
inet6 addr: fe80::2a0:c9ff:fed7:1ade/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18660 errors:2 dropped:0 overruns:0 frame:2
TX packets:6207 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1799438 (1.7 MiB) TX bytes:1813295 (1.7 MiB)

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:2993 errors:0 dropped:0 overruns:0 frame:0
TX packets:2993 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:309405 (302.1 KiB) TX bytes:309405 (302.1 KiB)

tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:192.168.100.164 P-t-P:192.168.100.164 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1412 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:36 (36.0 b) TX bytes:64 (64.0



Kernel IP routing

table
Destination Gateway Genmask Flags MSS Window irtt Iface
92.198.46.70 192.168.50.1 255.255.255.255 UGH 1500 0 0 eth1
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
192.168.50.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
192.168.115.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
192.168.30.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
192.168.110.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
10.100.1.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
192.168.105.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
192.168.25.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
10.100.3.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 192.168.50.1 0.0.0.0 UG 0 0 0 eth1
b)



sysctl -p
net.ipv4.ip_forward = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
net.ipv4.conf.default.rp_filter = 1
kernel.sysrq = 0
net.ipv4.conf.default.accept_source_route = 0
kernel.shmall = 268435456
net.ipv4.tcp_syncookies = 1
kernel.core_uses_pid = 1



im gonna try pv's way but there is the info u ask in case of.
 
Old 10-15-2009, 10:22 AM   #6
Franxez
LQ Newbie
 
Registered: Feb 2009
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pvs View Post
you cannot ping anything, because the machine from 192.168.100.0 subnet simply does not "knows" where to send answers.

the simplest way when you're administrator only in subnet 192.168.50.0 is to do address translation
iptables -t nat -A POSTROUTUNG -d 192.168.100.0/24 -j SNAT --to-source 192.168.100.X
192.168.100.X - corresponding ip-address of your CentOS router

the other way (when you'ra administrator in 192.168.100.0 too): to make your CentOS default router or on your default router create static route to subnet 192.168.50.0/24 using gateway 192.168.100.X

third way is to specify route to subnet 192.168.50.0 via 192.168.100.X on each machine in subnet 192.168.100.0 (manually or via DHCP)
thx the nat work just fine.
 
  


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
Iptables for NAT on CentOS 5. Routing problems acidphyx Linux - Networking 4 09-17-2009 11:43 PM
pre routing , post routing and qos support msridhar87 Linux - Networking 0 02-13-2009 05:37 AM
CentOS 4.1 hosting squid and advanced routing freezing mysteriously dougbourne Linux - Networking 1 07-01-2008 08:21 AM
Centos 5.0 routing problem - Route not being honored jeenam Linux - Networking 5 03-08-2008 04:12 AM
Help With Routing Problem LAR12345 Linux - Networking 6 02-04-2003 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:11 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