LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-07-2006, 09:09 AM   #1
Slycer
LQ Newbie
 
Registered: Oct 2004
Distribution: Slackware
Posts: 24

Rep: Reputation: 15
[OpenBSD 3.9] NAT Configuration/ Static IP


Okay, this is the sitution:

I've been trying to set up my OpenBSD box as a gateway for a few days now. But because im new to BSD I don't really know what to do.
So far, I've configured my rl0 and rl1 device so that I can access the internet from my OpenBSD box and access the OpenBSD box from my main box (Win XP). But I cant access the internet from my main box, meaning the comminication stops somewhere between the boxes.


This is what i've done so far:

I've added this in /etc/rc.conf:
Code:
#router  
ifconfig_rl0="inet x.x.x.x netmask 255.255.192.0" # x.x.x.x jis my IP IP netmask is from my ISP  
defaultrouter="84.255.192.1" # gateway IP of my ISP    

ifconfig_rl1="inet 192.168.0.1 netmask 255.255.255.0"  
gateway_enable="YES"    
sshd_enable="YES"
I've made a file called hostname.rl1 undet /etc/ and in it i've written:
Code:
inet 192.168.0.1 255.255.255.0 NONE
I've added both DNS server in /etc/resolv.conf

I've uncommented the line "net.inet.ip.forwarding" and changed the value to 1.

These are my configs:

pf.conf
rc.conf
ifconfig
route

Any ideas?

UPDATE:
Added in /etc/pf.conf:

mainbox="192.168.0.2"

rdr on $ext_if proto tcp from any to any port 80 -> $mainbox
rdr on $ext_if proto tcp from any to any port 21 -> $mainbox
rdr on $ext_if proto tcp from any to any port 25 -> $mainbox
rdr on $ext_if proto tcp from any to any port 110 -> $mainbox
 
Old 05-08-2006, 09:01 PM   #2
Gsee
Member
 
Registered: Mar 2004
Location: Australia
Distribution: FreeBSD, OpenBSD, Gentoo, Debian
Posts: 153

Rep: Reputation: 30
Have you:

a) rebooted since you changed the line in /etc/sysctl.conf
or
b) run sysctl net.inet.ip.forwarding=1

else, have you:

a) enabeld pf in /etc/rc.conf? (I can't seem to access your attached files)
b) have you rebooted since that?
or
b) run pfctl -e to manually enable pf

Let me know then we'll take it from there.

Regards,

Gsee

P.S. Also make sure you've looked at the FAQ section - http://www.openbsd.org/faq/faq6.html#PF

Last edited by Gsee; 05-08-2006 at 09:04 PM.
 
Old 05-15-2006, 06:08 PM   #3
Slycer
LQ Newbie
 
Registered: Oct 2004
Distribution: Slackware
Posts: 24

Original Poster
Rep: Reputation: 15
Hey, thanks for the help, but I already solved the problem.

The trick was to manualy enable the pf. For some reason it wouldnt start even tough it was enabled in rc.conf. Weird.


Tnx anyway.
 
Old 05-15-2006, 07:08 PM   #4
Gsee
Member
 
Registered: Mar 2004
Location: Australia
Distribution: FreeBSD, OpenBSD, Gentoo, Debian
Posts: 153

Rep: Reputation: 30
Good to hear you've solved your problem. Double check the syntax in your rc.conf file - also be aware that changes in this file make no difference until the file is read at boot time.

Gsee
 
Old 05-16-2006, 04:14 AM   #5
Slycer
LQ Newbie
 
Registered: Oct 2004
Distribution: Slackware
Posts: 24

Original Poster
Rep: Reputation: 15
This is the section in rc.conf:

http://extraball.sunsite.dk/notepad.php?ID=17459



Notice anything wrong?
 
  


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
Remote access via static NAT mattp Linux - Security 5 01-13-2006 07:36 AM
OpenBSD ppp configuration - any howtos?? lazlow69 *BSD 0 11-13-2005 10:20 PM
Static NAT / DMZ / VPN question Funky D Linux - Networking 1 10-22-2004 07:17 AM
dhcp -> static ip configuration. linux_faq Linux - Networking 1 07-04-2004 12:16 AM
Static IP configuration anorman Linux - Networking 2 08-25-2003 03:20 PM

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

All times are GMT -5. The time now is 10:59 AM.

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