LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 08-31-2004, 03:26 AM   #1
Crunch
Member
 
Registered: Feb 2003
Location: York, PA
Distribution: Slackware, FreeBSD, OpenBSD
Posts: 162

Rep: Reputation: 30
Networking (PF/NAT)


Right now I'm browsing on lynx. I am building a gateway/nat/firewall
on my mini OpenBSD box. I need a little help on this, I'm a bit stuck.
I've consulted the manual pages about 1,000 times and refered to a few
sites online. Hope no one minds giving me a hand =)

Alright on with my problem. I've been currently attempting to build
an OpenBSD (3.6) firewall. The firewall is intended to be a Gateway /
Firewall for my LAN.

I've been having a few problems with what I'm pretty sure seems to be
the DNS (supposed to be obtained automatically). While using the
router I was checking the DHCP-client end of it to see the
assignments matched the ones that I had on my OpenBSD box.
They didn't match. Not even the IP matched. It's odd because when
ever I tried to manually set the address to the former (set the ip
as seen when using the router), it didn't work. Although when I just
allowed dhclient to auto-fetch everything, it worked... the one
problem is my LAN though. No one on the LAN is able to get online.
I enabled net.inet.forward=1 (I'm going by memory with the names in
sysctl.conf). Then just to test I enabled pf, configured pf.conf
with the lines reading: (I'm going by mem. again somethings might be
a little goofy.)
ext_if = "xl0"
int_if = "rl0"

## Trafficing
scrub in fragment reassemble all

## NAT
nat on $ext_if from 192.168/24 to any -> $ext_if

## Filter
pass all # To test.

I can't really say as to where I messed up... if anyone wants all
of the configuration files, I'll just upload them.

Oh yeah forgot to add...
IP for OpenBSD box: 192.168.0.1 (rl0)
Subnet-mask: 255.255.255.0 (rl0)
Broadcast-address: 192.168.0.255 (rl0)# I think this is the odd part...

Netmask... or maybe broadcast-addr. Maybe it's even the DNS...
actually I think the DNS is 192.168.0.1, so this might be the problem.

Once again, thanks guys.
 
Old 08-31-2004, 11:05 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Well it's rather hard to tell from your post whether you're trying to configure a static IP on a DHCP-enabled segment, or if you are attempting to use DHCP for your external address, so perhaps you could clarify that.

One thing to note is that the syntax (interface) means "the current IP of interface", which is required if you're using interfaces that get their IP from DHCP. If your external IP is assigned by DHCP, then you need to change
nat on $ext_if from 192.168/24 to any -> $ext_if
to
nat on $ext_if from 192.168/24 to any -> ($ext_if)

Also, how are you assigning your internal IPs, gateway, and DNS settings? OpenBSD won't assign DHCP leases unless you explicitly configure DHCPd. You could of course manually assign values to your internal hosts, but it doesn't sound like you know what values to assign.
 
Old 08-31-2004, 12:06 PM   #3
Crunch
Member
 
Registered: Feb 2003
Location: York, PA
Distribution: Slackware, FreeBSD, OpenBSD
Posts: 162

Original Poster
Rep: Reputation: 30
For the internal IP addresses, I'm attempting to use DHCPD. I have it
setup so that they at least obtain an IP address out of the, "pool" of
IP addresses (192.168.0.2 through 192.168.0.24). I think you're right
though. I actually do think I'm getting myself caught up into trying
to assign a static IP to a DHCP IP. I'm pretty confused myself since
the ones on the network that obtain their IP address, they can connect
to only the OpenBSD gateway. That's it. When I checked the states
on pfctl -s state. I would see output that looked like...

xxx.xxx.xxx.xxx(Internal net):xx(port) <- xxx.xxx.xxx.xxx(person on network)
Then it would say on the far right some kind of message of what it
was doing. Wether it would be established or what not. Although it
wouldn't ever show anything from the LAN connecting to the external
NIC. So I think I am doing something wrong with the assignments of
the IP addresses. Any more suggestions?

Thanks for the response by the way.
 
Old 08-31-2004, 02:23 PM   #4
Crunch
Member
 
Registered: Feb 2003
Location: York, PA
Distribution: Slackware, FreeBSD, OpenBSD
Posts: 162

Original Poster
Rep: Reputation: 30
I don't think I'll need to post on this thread anymore. I just found on this forum (*BSD section), a thread of a person that's practically in my boat. =) I guess I didn't look everywhere then. I'll post there.
 
Old 09-01-2004, 01:44 AM   #5
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
No, you're extremely confused because you do not have the same problem that rcottere has.

If your internal machines are getting an IP from DHCP and you can see their state established in PF, then things are mostly setup correctly. I still think you don't have your client DNS settings right. You won't be able to resolve the addresses of anything on the Internet if your DNS settings are incorrect.
 
Old 09-01-2004, 05:21 AM   #6
Crunch
Member
 
Registered: Feb 2003
Location: York, PA
Distribution: Slackware, FreeBSD, OpenBSD
Posts: 162

Original Poster
Rep: Reputation: 30
Ouch. Yeah then that might (or is) my problem. You know anyway to fix this? I'm pretty unsure as to where OpenBSD houses the configuration. I'll try to figure it out, if anyone responds thanks ahead of time.
 
  


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
General Networking questions..NAT/Router crnchyfrog Linux - Networking 5 11-07-2004 11:44 PM
I configure NAT and use "services ..." to save it but when I reboot there is no nat bruack Linux - Software 4 09-01-2004 02:38 AM
Susefirewall2 Nat Problem / nat 1:1 trubi Linux - Distributions 0 07-20-2004 05:50 AM
Random Networking to Non-Networking o-o Ne0BDP Slackware 3 07-08-2004 01:18 AM
What's the difference between Linux-NAT and Sygate-NAT? yuzuohong Linux - Networking 0 08-07-2002 04:07 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

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