# ipfw: getsockopt(IP_FW_ADD): Invalid argument



## enweniwe (Feb 23, 2011)

I get 
	
	



```
ipfw: getsockopt(IP_FW_ADD): Invalid argument
```
 when I run 

```
ipfw add fwd 127.0.0.1:25 tcp from not me to any 25
```


```
uname -a
FreeBSD relay.example.com 7.3-RELEASE FreeBSD 7.3-RELEASE #0: Sun Mar 21 06:
15:01 UTC 2010     [email]root@walker.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  i38
6
```


----------



## olegrpg (Mar 2, 2011)

Maybe 
	
	



```
options IPFIREWALL_FORWARD
```
 in kernel.


----------



## t4z3v4r3d (Sep 27, 2011)

Hi. I've got the same problem 


```
root@ :: t4yt4n5 :: /usr/src/sys/modules/ipfw  ipfw -v add 26 fwd me,25 tcp from any to me 1025 in via rl0
ipfw: getsockopt(IP_FW_ADD): Invalid argument
```


```
mkdep -f .depend -a   -nostdinc -DIPFIREWALL -DIPFIREWALL_NAT -DIPFIREWALL_FORWARD 
-DIPFIREWALL_DEFAULT_TO_ACCEPT -DIPSTEALTH -DIPDIVERT -DDUMMYNE -DIPFIREWALL 
-D_KERNEL -DKLD_MODULE -I/usr/src/sys/modules/ipfw/ .......
```

and my kernel


```
options         IPFIREWALL
options         IPFIREWALL_VERBOSE
options         IPFIREWALL_VERBOSE_LIMIT=0 # in 5'th edit
options         IPFIREWALL_DEFAULT_TO_ACCEPT
options         IPDIVERT
options         IPSTEALTH       # in 5'th edit
options         IPFIREWALL_FORWARD
```


----------

