LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-16-2004, 10:57 AM   #1
beebs
LQ Newbie
 
Registered: Sep 2004
Distribution: SuSE 8.2/Minix
Posts: 8

Rep: Reputation: 0
Setting up a gateway...


Hi, thanks for taking a look.

I have a Internet <> router <> OpenBSD system <> another router <> PC's

I want to set up my OpenBSD box as a gateway and firewall, as it already has 2 NICs.

However, I am unable to get it to work. I have enabled packet forwarding, and the two NIC's are called tl0 and dc0, having IP addresses of 192.168.1.3 and 192.168.1.4 respectively. tl0 is connected to the internet router, and dc0 is connected to the internal router. My default gateway is 192.168.1.1, the IP of the router.

The problem is, I can only ping the internal router and not the internet one from the OpenBSD system, and trying to use it as a gateway times out all the time.

Does anyone know why this might be? Do the border and internal routers need different subnet masks or something? If you need more info, please ask, this is driving me mad.

Thanks a lot.

Last edited by beebs; 10-16-2004 at 10:58 AM.
 
Old 10-16-2004, 11:00 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Try using ip addresses on different subnets for each section of your network - it will make the routing much more automatic and save you having to add static routes.
 
Old 10-16-2004, 11:18 AM   #3
beebs
LQ Newbie
 
Registered: Sep 2004
Distribution: SuSE 8.2/Minix
Posts: 8

Original Poster
Rep: Reputation: 0
Il do that, thanks.

What about the default gateway of the OpenBSD system? Should it be set to the IP of the internet router/modem, or something else? I don't unbderstand why I can't ping the internet router, but I can ping the internal router on the other side...

Thanks a lot if anyone can help.
 
Old 10-16-2004, 11:21 AM   #4
Ruler2112
Member
 
Registered: Oct 2004
Location: Michigan, US
Distribution: Redhat 7.3, 9.0; Slackware 10, 10.1, 10.2, 11; FreeBSD 7.0; KnoppMyth 5.5
Posts: 125

Rep: Reputation: 16
I agree - give each card a different range of IPs to use. I would think that you'd need to get your bsd box to see the external router as a first step - check to see what IP it's using and give your bsd box an IP in the same range. Don't worry about the internal stuff until you can see the external router as it may well require changes based on what you do with the externally connected card.

Best of luck.
 
Old 10-16-2004, 11:31 AM   #5
Ruler2112
Member
 
Registered: Oct 2004
Location: Michigan, US
Distribution: Redhat 7.3, 9.0; Slackware 10, 10.1, 10.2, 11; FreeBSD 7.0; KnoppMyth 5.5
Posts: 125

Rep: Reputation: 16
DOH! I type too slow.

Check to see if there's a firewall enabled on your external router as well and disable it if there is. (Be sure to unplug your 'net connection first.) It may be blocking the connection to the bsd box - if it is, you can go back and dig into the firewall settings.


The way I have my masquerading boxes set up is to have the default gateway of the card hooked to the internet set to that provided by my ISP and the gateway of the other card blank. (The iptables rules that I use can be seen in my other thread; although I discovered that they aren't 100% secure either, they work for masqing.)
 
Old 10-16-2004, 12:30 PM   #6
beebs
LQ Newbie
 
Registered: Sep 2004
Distribution: SuSE 8.2/Minix
Posts: 8

Original Poster
Rep: Reputation: 0
Yay! My OpenBSD box can talk to systems either side of it, here how:

External router set to 10.0.0.1, and external NIC set to 10.0.0.2
Internal Router and systems set to 192.168.1.x, internal NIC set to 192.168.1.3.

I can see how this works, but now using Windows and Linux systems on the internal side of the bsd router I cannot access the internet. I have set their default gateways to that of the OpenBSD router.

Any ideas?

And thanks a lot for such quick replies

Last edited by beebs; 10-16-2004 at 12:46 PM.
 
Old 10-16-2004, 04:26 PM   #7
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Re: Setting up a gateway...

Quote:
Originally posted by beebs
Hi, thanks for taking a look.

I have a Internet <> router <> OpenBSD system <> another router <> PC's

I want to set up my OpenBSD box as a gateway and firewall, as it already has 2 NICs.

However, I am unable to get it to work. I have enabled packet forwarding, and the two NIC's are called tl0 and dc0, having IP addresses of 192.168.1.3 and 192.168.1.4 respectively. tl0 is connected to the internet router, and dc0 is connected to the internal router. My default gateway is 192.168.1.1, the IP of the router.

The problem is, I can only ping the internal router and not the internet one from the OpenBSD system, and trying to use it as a gateway times out all the time.

Does anyone know why this might be? Do the border and internal routers need different subnet masks or something? If you need more info, please ask, this is driving me mad.

Thanks a lot.
I went through the same thing recently so I hope I can talk you through it.
If the router is using 10.0.0.X numbers set the net card interfacing with it on the same subnet e.g. 10.0.0.4 and same mask. Then try to ping it from the router box.
Now a rule I shall never forget ethernet addresses relate to the card and not to the box. On that box (BSD) set the gateway to the interfacing ethernet ip i.e. 10.0.0.4.
The second ethernet card is assigned an address 192.168.1.4 and interfaces with the boxes on the network. All the boxes behind it should be given this ip number as the gateway i.e. 192.168.1.4
Hope this helps.
 
  


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
Setting up a gateway with two eth's muru Linux - Networking 6 09-15-2005 07:08 PM
Setting up a Network Gateway Gomi Linux - Networking 2 03-24-2005 06:15 PM
Setting Up Linux for GATEWAY extremebfn Linux - Networking 2 08-27-2004 04:30 AM
Gateway Setting ChangeOfPace Linux - Networking 4 05-05-2004 08:44 AM
SUSE 9 setting gateway stress Linux - Networking 16 02-22-2004 01:37 AM

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

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