Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jun 2008 00:17:38 +0200
From:      Petar Bogdanovic <petar@smokva.net>
To:        freebsd-net@freebsd.org
Subject:   Re: IP-forwarding (help)
Message-ID:  <20080604221738.GA6776@pintail.smokva.net>
In-Reply-To: <wpiqwouczq.fsf@heho.snv.jussieu.fr>
References:  <wpiqwouczq.fsf@heho.snv.jussieu.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 04, 2008 at 11:06:01PM +0200, Arno J. Klaassen wrote:
> 
> Hello,
> 
> this is probably a FAQ and/or I'm to tired, but I'd be pleased
> if anyone can tell me what I do wrong :
> 
> I have a box with two interfaces, one connected to my lan
> (172.16. ), one to a test-box (192.168.1.1) :
> 
>   em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
>         ether xxx
>         inet 172.16.1.240 netmask 0xffffff00 broadcast 172.16.1.255
>         media: Ethernet autoselect (1000baseTX <full-duplex>)
>         status: active
> 
>   em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
>         ether xxx
>         inet 192.168.1.254 netmask 0xffffff00 broadcast 192.168.1.255
>         media: Ethernet autoselect (1000baseTX <full-duplex>)
>         status: active
> 
> 
> I enable ip.forwarding :
> 
>   # sysctl net.inet.ip.forwarding
>   net.inet.ip.forwarding: 1
> 
> 
> And this is my routing table :
> 
>  Internet:
>  Destination        Gateway            Flags    Refs      Use  Netif Expire
>  default            172.16.1.254       UGS         0       20    em0
>  127.0.0.1          127.0.0.1          UH          0        0    lo0
>  172.16.1.0/24      link#3             UC          0        0    em0
>  172.16.1.6         xxxxxxxxxxxxxxxxx  UHLW        1       87    em0   1194
>  172.16.1.230       xxxxxxxxxxxxxxxxx  UHLW        1      286    em0    572
>  172.16.1.240       xxxxxxxxxxxxxxxxx  UHLW        1        0    lo0
>  172.16.1.254       xxxxxxxxxxxxxxxxx  UHLW        2        0    em0    487
>  192.168.1.0/24     link#4             UC          0        0    em1
>  192.168.1.1        xxxxxxxxxxxxxxxxx  UHLW        1        2    em1    616
>  192.168.1.254      xxxxxxxxxxxxxxxxx  UHLW        1        0    lo0
> 
> For this I added to rc.conf :
> 
>   static_routes="test lan"
>   route_test="-net 192.168.1.0/24 192.168.1.254" 
>   route_lan="-net 172.16.1.0/24 172.16.1.240"

I'm pretty sure that you don't need these three lines. Turning
net.inet.ip.forwarding on should be enough.

Petar



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080604221738.GA6776>