LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices



Reply
 
Search this Thread
Old 04-23-2003, 09:32 PM   #1
bax
Member
 
Registered: Dec 2001
Location: NoVA
Distribution: Ubuntu, Solaris, OpenBSD
Posts: 492

Rep: Reputation: 30
Routing behind NAT


I plan to run my OpenBSD box as a firewall to a small network within my home 192.168.1.x network. Do I need to configure different subnets like 192.68.1.x for the whole network and 192.168.2.x for the one behind the OpenBSD box?
 
Old 04-25-2003, 03:11 AM   #2
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
generally a firewall is set up as a network bridge at the same time, seperating two networks and only allowing certain traffic through etc. The idea being that the machine as two network cards one set to the local network and the other set to the remote network. Often this remote network is your drect internet connection. In the case that you have a router connected to the internet and want this machine to firewall everything coming in from that router then yes it would be best to set the router address and one the the eth card addresses to be one the same sub-net, seperate from the local network.
 
Old 04-25-2003, 09:15 AM   #3
bax
Member
 
Registered: Dec 2001
Location: NoVA
Distribution: Ubuntu, Solaris, OpenBSD
Posts: 492

Original Poster
Rep: Reputation: 30
Thanks for the reply! OpenBSD is such a different animal so it feels like the first time again I'm firewalling my home network from my landlord's 192.168.1.x network. I was just wandering if "double nat" or more precisely "double pat" would work.
 
Old 04-25-2003, 08:29 PM   #4
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
should do the packets don't really care about the exact addresses, only that they know where to go. So your packets get re-written to look like they are coming from your gateway onto your landlords network and then the landlords network does basically the same thing onto the internet or whatever.
 
Old 04-26-2003, 02:27 PM   #5
bax
Member
 
Registered: Dec 2001
Location: NoVA
Distribution: Ubuntu, Solaris, OpenBSD
Posts: 492

Original Poster
Rep: Reputation: 30
OK, I've got my external NIC xl0 getting a dynamic address from the router, now how do I configure xl1 (internal NIC) to use xl0 as the uplink. Do I need to give xl0 a static IP? I'm still planning to use 192.168.2.x as my internal network. Is it simply a matter of configuring pf for NAT?
 
Old 04-26-2003, 06:38 PM   #6
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
You should just be able to add this as the default gateway

what you want is for xl0 to set up it's address as the default gateway when it is configured.

I must admit I don't know how to do this (I have never used BSD, it was only on your initial reply tht I realised I was in a BSD forum, sorry).

I know the route command is route -n add default address and I guess you could script that pretty easily but I'm sure there would be some way of doing it automatically. Try searching in google.
 
  


Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two-way NAT routing MPowers Linux - Networking 3 06-24-2005 04:24 PM
nat routing vaat Linux - Networking 11 02-16-2005 11:02 AM
routing through nat booyah Linux - Networking 3 01-17-2004 09:40 PM
real routing under nat routing nothingmuch Linux - Networking 4 10-27-2003 04:11 PM
Routing and nat Morning_Star Linux - Networking 5 02-11-2003 12:31 PM


All times are GMT -5. The time now is 03:38 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration