LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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
 
LinkBack Search this Thread
Old 07-16-2007, 11:49 PM   #1
tvliew
LQ Newbie
 
Registered: Jul 2007
Location: Singapore
Distribution: Redhat, Fedora Core
Posts: 7

Rep: Reputation: 0
Network - Routing between two networks problem


I am having problem trying to route between two networks using a RHEL4 distro. Here's how my network looks like:
Code:
[OpenSuSE 10.2]---------eth1-[RHEL4 Linux]-eth0-----------[Firewall]
10.0.0.101/16      10.0.0.100/16    192.168.1.225/24    192.168.1.1/24
I have other computers on the 192.168.1.0/24 network. All firewalls on OpenSuSE and RHEL4 are off. My routing table (route -n) is as follows:
Code:
Destination Gateway       Genmask       Flags Metric Ref Use Iface
192.168.1.0 192.168.1.225 255.255.255.0 UG    0      0   0   eth0
192.168.1.0 0.0.0.0       255.255.255.0 U     0      0   0   eth0
10.0.0.0    10.0.0.100    255.255.0.0   UG    0      0   0   eth1
10.0.0.0    0.0.0.0       255.255.0.0   U     0      0   0   eth1
IP forwarding is enabled.
cat /proc/sys/net/ipv4/ip_forward = 1

From OpenSuSE, I can ping 10.0.0.100 and 192.168.1.225. But I cannot ping 192.168.1.1 or any other devices within 192.168.1.0/24.

I just need the two networks to be able to ping each other from both sides. Does anyone have any comments?

I have been working on this for 1 week plus and no luck.



Last edited by tvliew; 07-17-2007 at 04:07 AM.
 
Old 07-17-2007, 05:38 AM   #2
tvliew
LQ Newbie
 
Registered: Jul 2007
Location: Singapore
Distribution: Redhat, Fedora Core
Posts: 7

Original Poster
Rep: Reputation: 0
Hi everyone,

I managed to get it working using the following:

Code:
[10.0.0.101/16]--------------[RHEL4]-------------[192.168.1.121/24]
                        eth1           eth0
                   10.0.0.100/16  192.168.1.225/24
The PC using 10.0.0.101/16, I set the gateway to point to 10.0.0.100/16. As for the PCs on 192.168.1.0/25, I set them to point to 192.168.1.225.

At the same time on RHEL4, I enabled iptables by the 'service iptables start' and enabled masquerading on both interfaces using the 'iptables -t nat -A POSTROUTING -j MASQUERADE' command.

I can ping any hosts on 192.168.1.0/24 from 10.0.0.0/16 and vise versa.

The idea of this design is that I intend to change 10.0.0.101 and 192.168.1.121 into Cisco routers so that I can do site-to-site VPN simulation. Are there any complications in this design?
 
Old 07-17-2007, 09:28 AM   #3
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
Quote:
Originally Posted by tvliew
The idea of this design is that I intend to change 10.0.0.101 and 192.168.1.121 into Cisco routers so that I can do site-to-site VPN simulation. Are there any complications in this design?
hi,

i think you have missed the term site-to-site.
site-to-site is router-to-router connection.

in your design you only have one router.

why you can ping both machine? not sure which IP you have pinged, and whether you have set your router correctly.

HTH.

Last edited by rossonieri#1; 07-17-2007 at 09:29 AM.
 
Old 07-17-2007, 07:47 PM   #4
tvliew
LQ Newbie
 
Registered: Jul 2007
Location: Singapore
Distribution: Redhat, Fedora Core
Posts: 7

Original Poster
Rep: Reputation: 0
Hi rossonieri,

Thanks for the insight.

The idea of the design is that I wanted to simulate a site-to-site VPN. Yes, you are right about the router to router connection if VPN needs to be done.

The hosts at 10.0.0.101/16 and 192.168.1.121/24 will be replaced by Cisco 871 routers to do VPN. Because both side will have different public IPs, I have to design it in such a way that it simulates real world environment. However, in order for me to simulate a real world site-to-site VPN, I need 2 public IPs. However, I have a dynamic IP at my home and no where else to connect it. So ,the RHEL4 will act a many routers around the world put in one machine. I had problems trying to do IP forwarding and found another solution which I am not sure will world for my real world simulation.

But before I could start replacing the hosts to Cisco routers, I have to make sure the RHEL4 works so I placed 2 PCs at the sides and see if they can ping one another on both sides. That is where my question came along....

I did a MASQUERADing on the RHEL4 and both hosts on both sides of the network can ping each other. My question is that when I later replace the hosts to Cisco routers, will this be a good real-world environment test for VPN???? I am going to try later and see if it works...

I hope this clarifies what I am trying to do. I welcome any comments or ideas which you may have.
 
Old 07-18-2007, 07:50 AM   #5
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: KirraMail Live Email Server
Posts: 1,215

Rep: Reputation: 56
You'll find that the iptables masquerading will be doing all the work and will be letting that packets pass back and forth between the 2 networks. If you remove the iptable rules you will find that the packets will stop.

The reason being, is you have not added a route back to each of the networks, for example,when the 10 network receives a data packet from the 192 network, since it's not on the same network it will by default send it to that networks default gateway, and vice versa for the 192 network.

Best thing to do is to delete all the iptables rules and then add some routes to the gateway.

route add -net 192.168.1.0/24 gw 10.0.0.100
route add -net 10.0.0.0/8 gw 192.168.1.225

Or what ever address you have assigned to the network cards, those command should work although it has beens years since i've used them so you may need to check them out first.
 
Old 07-18-2007, 08:34 AM   #6
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
Quote:
Originally Posted by tvliew
Hi rossonieri,

Thanks for the insight.


The hosts at 10.0.0.101/16 and 192.168.1.121/24 will be replaced by Cisco 871 routers to do VPN. Because both side will have different public IPs, I have to design it in such a way that it simulates real world environment. However, in order for me to simulate a real world site-to-site VPN, I need 2 public IPs. However, I have a dynamic IP at my home and no where else to connect it. So ,the RHEL4 will act a many routers around the world put in one machine. I had problems trying to do IP forwarding and found another solution which I am not sure will world for my real world simulation.


I hope this clarifies what I am trying to do. I welcome any comments or ideas which you may have.
very simple

[10.0.0.101/16]--------------[RHEL4]-------------[192.168.1.121/24]

your picture is OK. just make sure that the middle box become the cloud only. so your real router will be your 2 end-point.
you have to turn on NAT MASQ on both end point 101 and 121.

from there see how you must dealing with "real" NAT and VPN - because you must pass thru the middle-box.

activate default inbound-blocking iptables.

HTH.
 
Old 07-20-2007, 02:46 PM   #7
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 229Reputation: 229Reputation: 229
OP,
When you do replace the 2 hosts we've been discussing w/ the Cisco routers, will there be be 2 subnets or 3? Will your regular/existing hosts be separate, or will they be included in one of the VPN test nets?

Do you have DHCP service on your LAN now? If so, what provides it?

What do they, the Cisco routers, cost?


All,
What is the best way to simulate "the cloud" -- the real 'Net -- after the Cisco routers are in place? Especially how should they, & their subnets, get their IP addresses? (I am not familiar w/ these routers.)
 
Old 07-21-2007, 03:28 AM   #8
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
Quote:
Originally Posted by archtoad6
OP,
When you do replace the 2 hosts we've been discussing w/ the Cisco routers, will there be be 2 subnets or 3? Will your regular/existing hosts be separate, or will they be included in one of the VPN test nets?

Do you have DHCP service on your LAN now? If so, what provides it?

What do they, the Cisco routers, cost?


All,
What is the best way to simulate "the cloud" -- the real 'Net -- after the Cisco routers are in place? Especially how should they, & their subnets, get their IP addresses? (I am not familiar w/ these routers.)
i'll try to answer, correct me if i'm wrong

still using the diagram :
[10.0.0.101/16]gw 0.1------[RHEL4]---------gw 1.1[192.168.1.121/24]

basically - vpn means to extending your LAN - hence local and remote subnet will be the same. unfortunately, if you use the same range before the vpn establish, your router get confuse picking the routing path. thus we need different subnet and some spare ip range in that subnet to be use for remote vpn client using either dhcp or static.

example :
subnet A 0.0/16 --> free 0.200 to 0.210 for remote vpn client,
subnet B 1.0/24 --> free 1.100 to 1.110 and so on...

you dont have to use VPN, why?
performing DNAT (overlapping NAT) for remote subnet will do OK.

example :
remote NATed subnet A 0.1 become 1.141 to 1.151 in subnet B.

why we need to simulate the cloud?
OK - the cloud will do just fine using LAN speed router, but this will be the challenge - because the WAN has much lower speed and barrier - including router IP in dynamic or static, performing NAT etc.

HTH.

Last edited by rossonieri#1; 07-21-2007 at 03:41 AM.
 
Old 07-22-2007, 10:01 AM   #9
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 229Reputation: 229Reputation: 229
OP,

We had a HAL-PC/HLUG Samba & Open Networking SIG meeting yesterday & discussed your situation. Consensus was you can't easily simulate Cisco hardware on an RHEL or SuSE box. You have already fallen into one trap by using iptables, a feature you can't, AFAIK, access on the Cisco routers, to make your test setup work. Best thing to do, if possible, is to put the Cisco's in your LAN now & proceed w/ testing them & learning about them. Have they been purchased yet?


Your test setup would look something like this:
Code:
  (       )
( the  'Net ) ------- firewall  
  (       )        [192.168.1.1/24]
                         |
   +--+--+--+------------+------------------+
   |  |  |  |            |                  | 
  existing LAN     [192.168.1.x]      [192.168.1.y]
                     Cisco #1           Cisco #2
                  [10.0.0.100/16]    [10.0.0.101/16]
                         |                  |
                  Test Desktop #1    Test Desktop #2
Your LAN stands in for the 'Net, your firewall for the ISP's they will ultimately be connected to.
 
Old 07-22-2007, 10:28 AM   #10
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263

Rep: Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562
When I needed to use my laptop to route traffic to my wireless router, I found that I needed to modprobe the ip_conntrack module before it would work. I didn't need to mess with iptable rules however.

A pair of VPNs would normally have public IPs on the internet side. Maybe placing a linux host in between the routers would make for a better simulation. It would represent the cloud, and it's IP addresses would be different from either subnet. You could have a pair of host routes. It just needs to transfer the encrypted traffic between the two routers.
 
Old 07-24-2007, 06:46 AM   #11
tvliew
LQ Newbie
 
Registered: Jul 2007
Location: Singapore
Distribution: Redhat, Fedora Core
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by archtoad6
OP,

We had a HAL-PC/HLUG Samba & Open Networking SIG meeting yesterday & discussed your situation. Consensus was you can't easily simulate Cisco hardware on an RHEL or SuSE box. You have already fallen into one trap by using iptables, a feature you can't, AFAIK, access on the Cisco routers, to make your test setup work. Best thing to do, if possible, is to put the Cisco's in your LAN now & proceed w/ testing them & learning about them. Have they been purchased yet?


Your test setup would look something like this:
Code:
  (       )
( the  'Net ) ------- firewall  
  (       )        [192.168.1.1/24]
                         |
   +--+--+--+------------+------------------+
   |  |  |  |            |                  | 
  existing LAN     [192.168.1.x]      [192.168.1.y]
                     Cisco #1           Cisco #2
                  [10.0.0.100/16]    [10.0.0.101/16]
                         |                  |
                  Test Desktop #1    Test Desktop #2
Your LAN stands in for the 'Net, your firewall for the ISP's they will ultimately be connected to.
Hi archtoad,

Thanks for the reply. We have the Cisco units with us already. It's running on IOS v12.4. We had problems pinging the boxes using our initial configuration but solved it using 'ip route'. But all in all, VPN doesn't seem to work even when using the SDM wizard or using CLI (with commands provided from http://www.vpnc.org/InteropProfiles/cisco-ios.txt).

With the diagram you have shown me, when I perform the VPN, if I am right, I should have Cisco #1 point to Cisco #2 and visa-versa, am I right?

What is the purpose of the firewall or ISP? Will it be there so that the 10.0.0.100/16 and 10.0.0.101/16 will be able to surf the Internet via the Cisco routers also?

I will get this setup up and ready immediately and test if it works.
 
Old 07-24-2007, 11:30 PM   #12
tvliew
LQ Newbie
 
Registered: Jul 2007
Location: Singapore
Distribution: Redhat, Fedora Core
Posts: 7

Original Poster
Rep: Reputation: 0
VPN working

Hi all,

Just want to update everything regarding the VPN project I am doing. By using archtoad's suggestion by putting both CISCO's WAN side on the same subnet, it works. On top of that, I removed the RHEL4 and placed both WAN side of the CISCO router to the same subnet and it works.

If I put my RHEL4 router in between the CISCO router and then performed VPN, it doesn't work. CISCO debug function could not contact the peer router. Both peer routers can ping each other but I had to do a 'ip route [WAN side network or peer router] [subnet mask] [receiving end of RHEL router]' on both CISCO routers.

I know that by using the 'iptables -t nat -A POSTROUTING -j MASQUERADE' would do a SNAT for any incoming packets going to it. Is this the reason why the VPN doesn't work?

So, on the Internet, as a packet is passed between routers, the source IP never changes.

I found another article on the Internet. They use IPCHAINS instead of IPTABLES. Here's the site: http://www.linuxjournal.com/article/5826. I don't know what does IPCHAINS does. What does it do and can we use this to simulate the Internet environment?
 
Old 07-25-2007, 06:27 AM   #13
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi,

OK - what VPN type you use for your project?
was it basic GRE or IPSec?
does this cisco router become your internet gateway router also?
have you done NAT? if yes, have you allow the VPN traffic?
what is the debug ip traffic result?
check the vpn route.

post them so we can help.

well, IMHO - if you use the same subnet for VPN - dont bother doing VPN --> that is what we call basic switching - just turn on the firewall .

just check my and jschiwal previous post.

IPChains is the "old version" of IPTables.

HTH.

Last edited by rossonieri#1; 07-25-2007 at 06:34 AM.
 
Old 07-25-2007, 08:02 PM   #14
tvliew
LQ Newbie
 
Registered: Jul 2007
Location: Singapore
Distribution: Redhat, Fedora Core
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rossonieri#1
hi,

OK - what VPN type you use for your project?
was it basic GRE or IPSec?
I am using IPSec

Quote:
does this cisco router become your internet gateway router also?
No, it doesn't. There's another gateway so I did a 'ip route 0.0.0.0 0.0.0.0 [gateway address]' and a 'ip route [private LAN network] [private LAN mask] [destination's local global IP]' for VPN traffic.

Quote:
have you done NAT? if yes, have you allow the VPN traffic?
Yes. NATting was performed. SDM automatically creates the NATting.

Quote:
what is the debug ip traffic result?
check the vpn route.
I'll have them resimulated again....

Quote:

post them so we can help.

well, IMHO - if you use the same subnet for VPN - dont bother doing VPN --> that is what we call basic switching - just turn on the firewall .

just check my and jschiwal previous post.

IPChains is the "old version" of IPTables.

HTH.
 
  


Reply

Tags
art, ascii, asciiart, diagram


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need simple routing distro that can handle >2 networks Ex Noctem Linux - Networking 5 07-17-2007 03:18 AM
2 networks, 2 gateways, routing help guitara Linux - Networking 0 05-20-2006 06:37 PM
2 network cards, 2 network connections - routing problem tvojvodi Linux - Networking 4 02-24-2004 03:26 PM
routing problem between 2 networks bligg Linux - Networking 6 10-27-2003 02:33 AM
Routing 2 incoming networks into 1 ivanatora Linux - Networking 1 10-19-2003 12:56 PM


All times are GMT -5. The time now is 08:58 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration