Почему не рекомендуется? И тогда как записать эти правила по другому?
1.ifconfig
Код: Выделить всё
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=198<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
ether 00:19:d1:e4:ca:3b
inet 10.0.1.3 netmask 0xffffff00 broadcast 10.0.1.255
media: Ethernet autoselect (1000baseTX <full-duplex>)
status: active
xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9<RXCSUM,VLAN_MTU>
ether 00:01:02:aa:95:ba
inet 10.0.10.82 netmask 0xffffff00 broadcast 10.0.10.255
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
2.netstat -rnW
Код: Выделить всё
Routing tables
Internet:
Destination Gateway Flags Refs Use Mtu Netif Expire
default 10.0.1.1 UGS 0 954178 1500 em0
10.0.1.0/24 link#1 UC 0 0 1500 em0
10.0.1.1 00:13:1a:37:23:80 UHLW 2 0 1500 em0 708
10.0.1.6 00:26:55:4c:01:4a UHLW 1 0 1500 em0 943
10.0.1.24 00:1d:92:65:29:63 UHLW 1 0 1500 em0 943
10.0.10.0/24 link#2 UC 0 0 1500 xl0
10.0.10.14 00:1a:4b:f1:8d:6a UHLW 1 3365 1500 xl0 1198
10.0.10.17 00:1b:78:9e:a0:6c UHLW 1 80096 1500 xl0 1163
10.0.10.27 00:21:5a:eb:73:50 UHLW 1 87202 1500 xl0 1197
10.0.10.30 00:03:47:e1:c3:5f UHLW 1 0 1500 xl0 701
10.0.10.33 00:15:5d:0a:66:00 UHLW 1 9103 1500 xl0 1171
10.0.10.56 00:24:01:f5:8b:06 UHLW 1 55 1500 xl0 1197
10.0.10.80 00:1c:c0:03:17:d1 UHLW 1 0 1500 xl0 1047
10.0.10.81 00:1c:c0:3b:5a:fd UHLW 1 71871 1500 xl0 1142
10.0.10.83 00:03:ff:2f:f5:37 UHLW 1 0 1500 xl0 1181
10.0.10.84 00:1e:90:c1:ad:10 UHLW 1 7448 1500 xl0 1107
10.0.10.85 00:19:21:2e:f5:37 UHLW 1 46777 1500 xl0 1193
10.0.10.86 00:03:ff:9a:66:d0 UHLW 1 0 1500 xl0 1126
10.0.10.87 00:1d:92:65:29:63 UHLW 1 574067 1500 xl0 1197
10.0.10.99 00:1c:c0:75:8b:14 UHLW 1 200 1500 xl0 1143
10.0.10.104 00:19:d1:31:5e:c5 UHLW 1 0 1500 xl0 1118
10.0.10.107 00:19:d1:91:cf:ad UHLW 1 7452 1500 xl0 1137
10.0.10.108 00:1c:c0:10:51:b5 UHLW 1 0 1500 xl0 1045
10.0.10.110 00:11:11:43:1a:0b UHLW 1 3539 1500 xl0 637
10.0.10.119 00:1c:c0:61:d1:5f UHLW 1 3055 1500 xl0 815
10.0.10.122 00:1c:c0:5a:72:0c UHLW 1 15 1500 xl0 832
10.0.10.124 00:1c:c0:7f:19:7e UHLW 1 0 1500 xl0 1028
10.0.10.125 00:0c:f1:f3:ea:fa UHLW 1 0 1500 xl0 1198
10.0.10.128 00:14:2a:4f:85:94 UHLW 1 30 1500 xl0 1140
10.0.10.131 00:26:18:a8:f7:5e UHLW 1 0 1500 xl0 943
10.0.10.132 00:1c:c0:10:52:47 UHLW 1 4926 1500 xl0 861
10.0.10.136 00:1c:c0:0e:77:2d UHLW 1 416 1500 xl0 812
10.0.10.137 00:11:11:92:c1:d0 UHLW 1 83 1500 xl0 1168
10.0.10.138 00:50:22:8a:fb:79 UHLW 1 0 1500 xl0 662
10.0.10.139 00:1c:c0:0e:76:a2 UHLW 1 2743 1500 xl0 1039
10.0.10.142 00:18:f3:02:f4:1c UHLW 1 1664 1500 xl0 615
10.0.10.145 00:1c:c0:2a:b6:23 UHLW 1 1027 1500 xl0 971
10.0.10.148 00:1c:c0:20:66:8a UHLW 1 0 1500 xl0 1181
10.0.10.152 00:1c:c0:75:8a:cb UHLW 1 117 1500 xl0 142
10.0.10.153 00:1c:c0:3b:5a:f2 UHLW 1 10536 1500 xl0 961
10.0.10.156 00:1c:c0:61:d1:31 UHLW 1 15 1500 xl0 362
10.0.10.158 00:13:d4:46:b1:c2 UHLW 1 482 1500 xl0 1047
10.0.10.161 00:1c:c0:54:94:80 UHLW 1 2259 1500 xl0 1041
10.0.10.162 00:1c:c0:78:a7:e9 UHLW 1 13147 1500 xl0 1016
10.0.10.164 00:0f:fe:ac:38:cd UHLW 1 0 1500 xl0 1034
10.0.10.165 00:1c:c0:7e:3f:91 UHLW 1 12 1500 xl0 649
10.0.10.167 00:1c:c0:4f:ad:cc UHLW 1 1086 1500 xl0 930
10.0.10.168 00:1c:c0:15:ad:83 UHLW 1 0 1500 xl0 1087
10.0.10.169 00:19:d1:1a:b1:16 UHLW 1 44 1500 xl0 997
10.0.10.172 00:11:11:53:5e:7b UHLW 1 1786 1500 xl0 923
10.0.10.176 00:1c:c0:03:19:4d UHLW 1 0 1500 xl0 262
10.0.10.177 00:19:d1:fe:9d:f3 UHLW 1 29 1500 xl0 1127
10.0.10.179 00:26:18:d5:b3:76 UHLW 1 2741 1500 xl0 1152
10.0.10.182 00:1c:c0:7b:40:85 UHLW 1 0 1500 xl0 1006
10.0.10.185 00:0c:29:15:f2:1a UHLW 1 0 1500 xl0 1168
10.0.10.233 00:11:11:c0:3c:7b UHLW 1 18 1500 xl0 924
127.0.0.1 127.0.0.1 UH 0 8636 16384 lo0
Internet6:
Destination Gateway Flags Refs Use Mtu Netif Expire
::1 ::1 UHL 1 0 16384 lo0
fe80::%lo0/64 fe80::1%lo0 U 0 0 16384 lo0
fe80::1%lo0 link#3 UHL 1 0 16384 lo0
ff01:3::/32 fe80::1%lo0 UC 0 0 16384 lo0
ff02::%lo0/32 fe80::1%lo0 UC 0 0 16384 lo0
3.ipfw show до написания злосчастного правила
Код: Выделить всё
00100 17112 2444752 allow ip from any to any via lo0
00200 0 0 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
00400 62363 6699143 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:19:21:2e:f5:37 in via xl0
00500 0 0 allow tag 777 ip from 10.0.10.0/24 to any MAC any 04:1e:64:d0:c3:35 in via xl0
00600 160 17987 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:11:11:c0:3c:7b in via xl0
00700 6983 1469577 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:18:f3:04:77:c1 in via xl0
00800 314940 14325398 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:1d:92:65:29:63 in via xl0
00900 191 26064 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:26:b0:2c:a9:13 in via xl0
01000 5047777 2052693875 allow ip from any to any layer2
01050 2414884 993323732 nat 1 ip from any to any via em0
01100 384637 22538169 skipto 10000 ip from 10.0.10.0/24 to any tagged 777 in via xl0
01200 448038 76501096 allow tcp from 10.0.10.0/24 to 10.0.10.82 dst-port 3333,20,21 in via xl0
01300 1490323 800861468 allow ip from any to 10.0.10.0/24 out via xl0
01400 182616 157849619 allow ip from 10.0.10.0/24 to any established in via xl0
01500 53375 6172802 allow ip from 10.0.10.27 to 10.0.10.82 in via xl0
01600 242210 17106589 deny ip from any to any
10000 384637 22538169 allow untag 777 ip from 10.0.10.0/24 to any in via xl0
65535 155 106559 deny ip from any to any
4. ipfw show после написания правила
Код: Выделить всё
00100 30 2540 allow ip from any to any via lo0
00200 0 0 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
00400 0 0 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:19:21:2e:f5:37 in via xl0
00500 0 0 allow tag 777 ip from 10.0.10.0/24 to any MAC any 04:1e:64:d0:c3:35 in via xl0
00600 0 0 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:11:11:c0:3c:7b in via xl0
00700 0 0 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:18:f3:04:77:c1 in via xl0
00800 30 4574 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:1d:92:65:29:63 in via xl0
00900 0 0 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:26:b0:2c:a9:13 in via xl0
01000 0 0 allow tag 777 ip from 10.0.10.0/24 to any MAC any 00:25:d3:6a:da:be in via xl0
01050 266 78620 nat 1 ip from any to any via em0
01100 1177 328581 allow ip from any to any layer2
01200 30 4574 skipto 10000 ip from 10.0.10.0/24 to any tagged 777 in via xl0
01300 478 109440 allow tcp from 10.0.10.0/24 to 10.0.10.82 dst-port 3333,20,21 in via xl0
01400 526 194314 allow ip from any to 10.0.10.0/24 out via xl0
01500 36 16608 allow ip from 10.0.10.0/24 to any established in via xl0
01600 0 0 allow ip from 10.0.10.27 to 10.0.10.82 in via xl0
01700 94 6240 deny ip from any to any
10000 30 4574 allow untag 777 ip from 10.0.10.0/24 to any in via xl0
65535 159 106878 deny ip from any to any