[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PF and NAT (simple) -(sysctl.conf has been edited already)



hi 
 
System : OpenBSD 3.5 GENERIC i386 
 
I am trying to connect my PCs to net over an OpenBSD NAT gateway. 
There are two ethernet interfaces on my openbsd box. external is "vr0" (which 
is connected to internet) and internal is (which is connected to switch) 
"rl0". 
 
# echo dhcp > /etc/hostname.vr0 
# echo "inet 192.168.0.1 255.255.255.0 NONE" > /etc/hostname.rl0 
(I also tried 192.168.0.0!) 
then edited /etc/sysctl.conf, /etc/pf.conf and /etc/rc.conf files and added 
the lines below 
 
in /etc/sysctl.conf
----------------------
net.inet.ip.forwarding=1

in rc.conf 
------------ 
pf=YES 
 
in pf.conf 
------------ 
ext_if="vr0" 
int_if="rl0" 
 
 nat on $ext_if from $int_if:network to any -> ($ext_if) 
 
And the output of my "pfctl -sn" is 
 nat on vr0 from inet 192.198.0.0/24 to any -> (vr0) 
 
I can connect to internet with my openbsd box. And ping the other machine on 
my network (and also to another machine on the internet). But other machine 
(which I pinged before) cannot connect to internet! 
What is wrong? Is there a problem with IP address of rl0? 
 If I use dhcp for rl0, but interface cannot get the IP addresses (I know from 
output of "ifconfig -a" and "errors given by PF") 
 
 Thanks for your advices... 



Visit your host, monkey.org