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

Re: routing in openbsd



ktb <xyf_(_at_)_nixnotes_(_dot_)_org> writes:

> The routing table on the OpenBSD box I've been working with looks like -
> Internet:
> Destination      Gateway            Flags 
> default          147.48.71.254      UG     
> 127.0.0.0        127.0.0.1          UG     
> 127.0.0.1        127.0.0.1          UH     
> 147.48.63.0      link#2             U      
> 147.48.63.2      127.0.0.1          UGH    
> 147.48.64.0      link#1             U      
> 147.48.71.254    0:7:eb:2f:6c:2     UH     
> 224.0.0.0        127.0.0.1          U      
> 
> I have been trying to add routes that would allow a client machine on
> 147.48.63.0/24 to assess the net though our gateway (outside of our
> building).  The subnet assigned to our building is 147.48.64/21 of the
> larger 137.48. class B network.
> 
> The OpenBSD router/firewall has an internal nic (147.48.63.2) and
> external nic (147.48.69.7).

Not sure why you don't see an entry like:

147.48.69.7     127.0.0.1      UGH

However, you don't need anything fancy to route from the internal to
external network here.  Configuring the interface addresses and
netmasks correctly and turning on ip forwarding should do the trick.

To turn on ip forwarding:

# sysctl -w net.inet.ip.forwarding=1

To make this survive reboot, edit /etc/sysctl.conf.  See sysctl(8),
sysctl.conf(5), hostname.if(5) and ifconfig(8).

More to the point, go read FAQ section 6, particularly 6.1.2 -
"Setting up your OpenBSD box as a Gateway", where this is all
described.

Good luck,

-- 
Andrew