NetBSD-Users archive

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

Re: [users] NAT in NPF



Thank you!

Your advice to make static IP helped and NAT started working.

However, when I use dynamic address and line:

map $ext_if $localnet -> ifaddrs(xennet0)

I get the error:

If I use variable, $ext_addrs = ifaddrs(xennet0) and use $ext_addrs in map lite I get the error:

What am I doing wrong?

30.11.2019 02:08, Luis P. Mendes пишет:
Hi,



On 20191129 21:22:19 +0300, Vladimir Zakrevskiy wrote:
Hello!

I have a strange situation when configuring NAT.

I have installed NetBSD on xen domU, enable ip forwarding and enable NPF.

npf.conf:

$ext_if = "xennet0"
$int_if = "xennet1"
$ext_addr = { inet4(xennet0) }
$int_addr = { inet4(xennet1) }
$localnet = { 172.20.76.0/24 }

alg "icmp"

#NAT
map $ext_if $localnet -> $ext_addr

With this config NAT is not working. Packets received on int_if and
don`t transmited from ext_if.

If i remove "map $ext_if $localnet -> $ext_addr" packets correct
transmited from ext_if.

I've setup an ARM based router and have some difficulties, as well.
My map line is:

map $ext_if dynamic 192.168.1.0/24 -> ifaddrs(ure0)

Be sure if you can treat xennet0 as using a static address.
Otherwise, if it changes, ifaddrs() should come in place of inet4()

Other odd thing (for me) thast I've experienced, is that
/etc/rc.d/npf_boot required the config file to be /etc/npf.bood.conf
and not /etc/npf.conf.
So, I `cp -l` /etc/npf.conf to /etc/npf.boot.conf.

Hope you can work it out.


Luis
-- 
С уважением, Закревский Владимир,
Центр системной интеграции и специальных проектов ЗАО "ЛМА"
тел. (812) 309-25-94, доб. 188
моб. (911) 986-90-02 


Home | Main Index | Thread Index | Old Index