На шлюзе поднят ng_nat. Работает без вопросов. Возникла необходимость пробросить порт на серый IP-шник. Исходя из man:NGM_NAT_REDIRECT_PORT (redirectport )
Redirect incoming connections arriving to given port(s) to another host and port(s). The following Vt struct ng_nat_redirect_port must be supplied as argument.
#define NG_NAT_DESC_LENGTH 64
struct ng_nat_redirect_port {
struct in_addr local_addr;
struct in_addr alias_addr;
struct in_addr remote_addr;
uint16_t local_port;
uint16_t alias_port;
uint16_t remote_port;
uint8_t proto;
char description[NG_NAT_DESC_LENGTH];
};
Redirection is assigned an unique ID which is returned as response to this message, and information about redirection added to list of static redirects which later can be retrieved by NGM_NAT_LIST_REDIRECTS message.
пытаюсь сделать следующее:
ngctl msg nat0: redirectport { local_addr=xx.xx.xx.xx alias_addr=xx.xx.xx.xx remote_addr=xx.xx.xx.xx local_port=18884 alias_port=18884 remote_port=18884 proto=tcp descripton="test" }
Результат: ngctl: send msg: Function not implemented.
Ради интереса даю: ngctl msg nat0: listredirects
Результат тот же: ngctl: send msg: Function not implemented.
Тогда пробую:
>ngctl msg nat0: nodeinfo
Rec'd response "nodeinfo" (805306374) from "[11]:":
Args: { name="nat0" type="nat" id=0x11 hooks=2 }
Т.е. именно функции специфичные для nat_ng по какой-то причине не доступны. Может кто подскажет, где собака зарыта???
>kldstat
Id Refs Address Size Name
1 15 0xc0400000 90687c kernel
2 1 0xc0d07000 1a04 ng_nat.ko
3 8 0xc0d09000 d3a0 netgraph.ko
4 2 0xc0d17000 9a54 libalias.ko
5 1 0xc0d21000 280c ng_ipfw.ko
6 2 0xc0d24000 ea78 ipfw.ko
7 1 0xc0d33000 6a32c acpi.ko
8 1 0xc1ee2000 4000 logo_saver.ko
9 1 0xc1f15000 5000 ng_netflow.ko
10 1 0xc1f39000 4000 ng_ether.ko
11 1 0xc1f3d000 2000 ng_split.ko
12 1 0xc1f40000 4000 ng_socket.ko
13 1 0xc2247000 5000 ng_ksocket.ko
>ngctl list
There are 9 total nodes:
Name: ngctl1468 Type: socket ID: 00000038 Num hooks: 0
Name: nat0 Type: nat ID: 00000011 Num hooks: 2
Name: <unnamed> Type: ksocket ID: 0000000c Num hooks: 1
Name: split0 Type: split ID: 00000009 Num hooks: 3
Name: netflow0 Type: netflow ID: 00000006 Num hooks: 7
Name: ral0 Type: ether ID: 00000004 Num hooks: 0
Name: vr1 Type: ether ID: 00000003 Num hooks: 0
Name: vr0 Type: ether ID: 00000002 Num hooks: 0
Name: ipfw Type: ipfw ID: 00000001 Num hooks: 5