91

UTiM пишет:

А вот накой вы включили на обоих интерфейсах маскарадинг?

не знаю. Вообще не понимаю, зачем тут DNAT, если уж NAT, то SNAT. Тогда узлы в первой сети, во второй могут иметь IP из второй сети, т.е. быть внутренними. Хотя зачем и кому это надо - я не знаю.

Карусель разнесло по цепочке за час
Всех известий — конец
Да, весна началась!
(всё к лицу подлецу, как родному отцу, не рассказывай, батя, и так всё пройдёт)

92

drBatty пишет:
UTiM пишет:

А вот накой вы включили на обоих интерфейсах маскарадинг?

не знаю. Вообще не понимаю, зачем тут DNAT, если уж NAT, то SNAT. Тогда узлы в первой сети, во второй могут иметь IP из второй сети, т.е. быть внутренними. Хотя зачем и кому это надо - я не знаю.

Поэтому я написал что DNAT для теста а после SNAT.

Ищу дополнительный заработок (удалёнка).
Пьянка без секса – признак алкоголизма.

93

UTiM пишет:

А вот накой вы включили на обоих интерфейсах маскарадинг?

Я не телепат чтоб знать какую подсеть автор темы хотел расшарить.
Поэтому завёл и обе.

Ищу дополнительный заработок (удалёнка).
Пьянка без секса – признак алкоголизма.

94

Kettler пишет:

После.

 Консоль:
nano /etc/sysconfig/scripts/SuSEfirewall2-custom

И туда

 Консоль:
iptables -I FORWARD 1 -i eth0 -o eth1 -j ACCEPT
iptables -I FORWARD 1 -i eth1 -o eth0 -j ACCEPT
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE

куда конкретно в нано вставлять эти строки?


#
# Authors: Marc Heuse,
#          Volker Kuhlmann <kuhlmav@elec.canterbury.ac.nz>
#
# /etc/sysconfig/scripts/SuSEfirewall2-custom
#
# ------------------------------------------------------------------------
#
# This is file is for SuSEfirewall2 and is an example for using
# the hooks which are supplied to load customized ipchains rules.
#
# THERE IS NO HELP FOR USING HOOKS EXCEPT THIS FILE ! SO READ CAREFULLY !
# IT IS USEFUL TO CROSS-READ /sbin/SuSEfirewall2 TO SEE HOW HOOKS WORK !
#
# ------------------------------------------------------------------------

fw_custom_after_chain_creation() {
    # these rules will be loaded after the various input_* and forward_* chains
    # are created.
    # You can use this hook to allow/deny certain IP protocols or TCP/UDP
    # ports before the SuSEfirewall2 generated rules are hit.

#example: always filter backorifice/netbus trojan connect requests and log them.
#for target in LOG DROP; do
#    for chain in input_ext input_dmz input_int forward_int forward_ext forward_dmz; do
#        iptables -A $chain -j $target -p tcp --dport 31337
#        iptables -A $chain -j $target -p udp --dport 31337
#        iptables -A $chain -j $target -p tcp --dport 12345:12346
#        iptables -A $chain -j $target -p udp --dport 12345:12346
#    done
#done

    true
}

fw_custom_before_port_handling() {
    # these rules will be loaded after the anti-spoofing and icmp handling
    # and after the input has been redirected to the input_XXX and
    # forward_XXX chains and some basic chain-specific anti-circumvention
    # rules have been set,
    # but before any IP protocol or TCP/UDP port allow/protection rules
    # will be set.
    # You can use this hook to allow/deny certain IP protocols or TCP/UDP
    # ports before the SuSEfirewall2 generated rules are hit.

    true
}

fw_custom_before_masq() { # could also be named "after_port_handling()"
    # these rules will be loaded after the IP protocol and TCP/UDP port
    # handling, but before any IP forwarding (routing), masquerading
    # will be done.
    # NOTE: reverse masquerading is before directly after
    #       fw_custom_before_port_handling !!!!
    # You can use this hook to ... hmmm ... I'm sure you'll find a use for
    # this ...

    true
}

fw_custom_before_denyall() { # could also be named "after_forwardmasq()"
    # these are the rules to be loaded after IP forwarding and masquerading
    # but before the logging and deny all section is set by SuSEfirewall2.
    # You can use this hook to prevent the logging of annoying packets.

#example: prevent logging of talk requests from anywhere
fw_custom_before_port_handling() {
    # these rules will be loaded after the anti-spoofing and icmp handling
    # and after the input has been redirected to the input_XXX and
    # forward_XXX chains and some basic chain-specific anti-circumvention
    # rules have been set,
    # but before any IP protocol or TCP/UDP port allow/protection rules
    # will be set.
    # You can use this hook to allow/deny certain IP protocols or TCP/UDP
    # ports before the SuSEfirewall2 generated rules are hit.

    true
}

fw_custom_before_masq() { # could also be named "after_port_handling()"
    # these rules will be loaded after the IP protocol and TCP/UDP port
    # handling, but before any IP forwarding (routing), masquerading
    # will be done.
    # NOTE: reverse masquerading is before directly after
    #       fw_custom_before_port_handling !!!!
    # You can use this hook to ... hmmm ... I'm sure you'll find a use for
    # this ...

    true
}

fw_custom_before_denyall() { # could also be named "after_forwardmasq()"
    # these are the rules to be loaded after IP forwarding and masquerading
    # but before the logging and deny all section is set by SuSEfirewall2.
    # You can use this hook to prevent the logging of annoying packets.

#example: prevent logging of talk requests from anywhere
#for chain in input_ext input_dmz input_int forward_int forward_ext forward_dmz; do
#    iptables -A $chain -j DROP -p udp --dport 517:518
#done

    true
}

благодарю

новичок

95

Функция fw_custom_after_chain_creation() до строчки true.

96

скопипастил..пинга между сетями нет..((((

#
# Authors: Marc Heuse,
#          Volker Kuhlmann <kuhlmav@elec.canterbury.ac.nz>
#
# /etc/sysconfig/scripts/SuSEfirewall2-custom
#
# ------------------------------------------------------------------------
#
# This is file is for SuSEfirewall2 and is an example for using
# the hooks which are supplied to load customized ipchains rules.
#
# THERE IS NO HELP FOR USING HOOKS EXCEPT THIS FILE ! SO READ CAREFULLY !
# IT IS USEFUL TO CROSS-READ /sbin/SuSEfirewall2 TO SEE HOW HOOKS WORK !
#
# ------------------------------------------------------------------------

fw_custom_after_chain_creation() {
    iptables -I FORWARD 1 -i eth0 -o eth1 -j ACCEPT
    iptables -I FORWARD 1 -i eth1 -o eth0 -j ACCEPT
    iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
    iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
    # these rules will be loaded after the various input_* and forward_* chains
    # are created.
    # You can use this hook to allow/deny certain IP protocols or TCP/UDP
    # ports before the SuSEfirewall2 generated rules are hit.

#example: always filter backorifice/netbus trojan connect requests and log them.
#for target in LOG DROP; do
#    for chain in input_ext input_dmz input_int forward_int forward_ext forward_dmz; do
#        iptables -A $chain -j $target -p tcp --dport 31337
#        iptables -A $chain -j $target -p udp --dport 31337
#        iptables -A $chain -j $target -p tcp --dport 12345:12346
#        iptables -A $chain -j $target -p udp --dport 12345:12346
#    done
#done

    true
}

fw_custom_before_port_handling() {
    # these rules will be loaded after the anti-spoofing and icmp handling
    # and after the input has been redirected to the input_XXX and
    # forward_XXX chains and some basic chain-specific anti-circumvention
    # rules have been set,
    # but before any IP protocol or TCP/UDP port allow/protection rules
    # will be set.
    # You can use this hook to allow/deny certain IP protocols or TCP/UDP
    # ports before the SuSEfirewall2 generated rules are hit.

    true
}

fw_custom_before_masq() { # could also be named "after_port_handling()"
    # these rules will be loaded after the IP protocol and TCP/UDP port
    # handling, but before any IP forwarding (routing), masquerading
    # will be done.
    # NOTE: reverse masquerading is before directly after
    #       fw_custom_before_port_handling !!!!
    # You can use this hook to ... hmmm ... I'm sure you'll find a use for
    # this ...

    true
}

новичок

97

правильно вставил? закомментированные строки удалать не надо?

новичок

98

Нет не надо.
Покажите выхлоп:
/sbin/SuSEfirewall2 stop
/sbin/SuSEfirewall2 start

99

linux-66f2:/home/lavr # nano /etc/sysconfig/scripts/SuSEfirewall2-custom
linux-66f2:/home/lavr # /sbin/SuSEfirewall2 stop
SuSEfirewall2: batch committing...
SuSEfirewall2: Firewall rules unloaded.
linux-66f2:/home/lavr # /sbin/SuSEfirewall2 start
SuSEfirewall2: Setting up rules from /etc/sysconfig/SuSEfirewall2 ...
SuSEfirewall2: batch committing...
SuSEfirewall2: Firewall rules successfully set
linux-66f2:/home/lavr #

новичок

100

У вас не загружается правила. Выполните:
sudo /sbin/yast2 sysconfig set FW_CUSTOMRULES="/etc/sysconfig/scripts/SuSEfirewall2-custom"
sudo /sbin/SuSEfirewall2 stop
sudo /sbin/SuSEfirewall2 start

101

огромное спасибо.
цель достигнута

новичок