ofMyCity forum
Форум => Компьютеры => Тема начата: subwoofer от 01 Декабря, 2008, 15:16:07
-
Вот попалось на глаза, что нат можно делать через iproute2:
Это именно NAT, в отличие от PAT, который через iptables
[root@masq-gw]# ip route add nat 205.254.211.17 via 192.168.100.17
[root@masq-gw]# ip rule add nat 205.254.211.17 from 192.168.100.17
[root@masq-gw]# ip route flush cache
[root@masq-gw]# ip route show table all | grep ^nat
nat 205.254.211.17 via 192.168.100.17 table local scope host
[root@masq-gw]# ip rule show
0: from all lookup local
32765: from 192.168.100.17 lookup main map-to 205.254.211.17
32766: from all lookup main
32767: from all lookup 253
This command tells the kernel to perform network address translation on any packet bound for 205.254.211.17. The parameter via tells the NAT code to rewrite the packet bound for 205.254.211.17 with the new destination address 192.168.100.17. Note, that this only handles inbound packets; that is, packets whose destination address contains 205.254.211.17.
This command enters the corresponding rule for the outbound traffic into the RPDB (kernel 2.2 and up). This rule will cause the kernel rewrite any packet from 192.168.100.17 with the specified source address (205.254.211.17). Any packet originating from 192.168.100.17 which passes through this router will trigger this rule. In short, this command rewrites the source address of outbound packets so that they appear to originate from the NAT IP.
The kernel maintains a routing cache to handle routing decisions more quickly (Section 4.7, “Routing Cache”). After making changes to the routing tables on a system, it is good practice to empty the routing cache with ip route flush cache. Once the cache is empty, the kernel is guaranteed to consult the routing tables again instead of the routing cache.
These two commands allow the user to inspect the routing policy database and the local routing table to determine if the NAT routes and rules were added correctly.
-
а почему энто PAT то ?
-
а мана говорит что - Warning: Route NAT is no longer supported in Linux 2.6. :-[
-
а почему энто PAT то ?
потому што Port Address Translation
а голый нат это када адин на адин транслируется
а мана говорит что - Warning: Route NAT is no longer supported in Linux 2.6.
и то правда, видимо, никто не пользовался :)
-
вот я и спрашиваю почему порт то?
ну в ДНАТе порт..а в СНАТе? а в маскараде ?
-
во всем тобой перечисленном - ПАТ
потому что два рагапила с серыми адресами занатятся в один и тот же квартет адресов-портов
а с ПАТом - каждый следущий получит сорс порт на адин больше, если исходный уже занят - и все будет работать..
кароче, фигня это все, зря я на флейту в первом класе отказался ходить, лабенил бы щас на дудке....
-
кароче, фигня это все, зря я на флейту в первом класе отказался ходить, лабенил бы щас на дудке..
и толку ? :)
-
одной рукой на гитаре, другой на дудке :) - почти оркестр ;)