Статья по базовой настройке SuSEfirewall2 (небольшой опус по теме фаервола в Suse Linux)

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

Аватара пользователя
Morgoth
Сообщения: 138
ОС: openSUSE 11.4

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Morgoth »

ситуация такая есть сетевая карточка eth0 подключенная к сети
ей соответствует "внешняя зона" брандмауэра FW_DEV_EXT="any eth0"

вопрос: Как с помощью брандмауэра запретить любую сетевую деятельность на этой карточке? Так чтобы гарантированно ничего не работало .

прописано FW_AUTOPROTECT_SERVICES="yes", но интернет все равно работает .
Спасибо сказали:
Vector08
Сообщения: 16

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Vector08 »

Настроил нат все удачно, человек ставит шлюзом мой сервер и получает интернет в браузере. дна проблема например если он использует аутлук то почту получить не может (
Что я забыл указать ? (
Спасибо сказали:
Vector08
Сообщения: 16

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Vector08 »

Или если можно пример, как разрешить определенному адресу все. Т.е. при использовании нат, человек получает доступ к любым портам и т.д., но желательно с определенного адреса
Спасибо сказали:
orci
Сообщения: 62

Re: Статья по базовой настройке SuSEfirewall2

Сообщение orci »

Если я хочу испльзовать только Iptables то мне надо выключать SuSeFirewall?:)
Просто у меня и то и то пашет:)) Просто с помощью Suse я сделал проброс из инета себе по одному порту в локалку.
А НАТ настраивал через iptables:)
Спасибо сказали:
Аватара пользователя
mr.Den
Сообщения: 116

Re: Статья по базовой настройке SuSEfirewall2

Сообщение mr.Den »

Как ограничить доступ
Хочу одним юзерам дать доступ в одну сеть другим в другое,разделение ХОТЯБЫ по ip
Спасибо сказали:
Yara
Сообщения: 43
ОС: Linux SUSE 10.3;Windows XP SP2

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Yara »

Обчная ситуация каких много. Есть компьютер с сюсей 10.3, есть 2 сетывые карты одна смотрит в интернет другая в локальную сеть (1 комп :D ). Нужно раздать интрнет на локальную сеть без всяких ограничений. Читал многое по этой теме, с иллюстрациями и.тп. Но так у меня ничего и не вышло((

Код:

# Copyright © 2000-2002 SuSE GmbH Nuernberg, Germany. All rights reserved. # Copyright © 2003,2004 SuSE Linux AG Nuernberg, Germany. All rights reserved. # Copyright © 2005-2007 SUSE LINUX Products GmbH Nuernberg, Germany. All rights reserved. # # Author: Marc Heuse, 2002 # Ludwig Nussel, 2004-2007 # # /etc/sysconfig/SuSEfirewall2 # # for use with /sbin/SuSEfirewall2 version 3.6 # # ------------------------------------------------------------------------ # # PLEASE NOTE THE FOLLOWING: # # Just by configuring these settings and using the SuSEfirewall2 you # are not secure per se! There is *not* such a thing you install and # hence you are saved from all (security) hazards. # # To ensure your security, you need also: # # * Secure all services you are offering to untrusted networks # (internet) You can do this by using software which has been # designed with security in mind (like postfix, vsftpd, ssh), # setting these up without misconfiguration and praying, that # they have got really no holes. Apparmor can help in # most circumstances to reduce the risk. # * Do not run untrusted software. (philosophical question, can # you trust SuSE or any other software distributor?) # * Check the security of your server(s) regulary # * If you are using this server as a firewall/bastion host to the # internet for an internal network, try to run proxy services # for everything and disable routing on this machine. # * If you run DNS on the firewall: disable untrusted zone # transfers and either don't allow access to it from the # internet or run it split-brained. # # Good luck! # # Yours, # SuSE Security Team # # ------------------------------------------------------------------------ # # Configuration HELP: # # If you have got any problems configuring this file, take a look at # /usr/share/doc/packages/SuSEfirewall2/EXAMPLES or use YaST # # # If you are an end-user who is NOT connected to two networks (read: # you have got a single user system and are using a dialup to the # internet) you just have to configure (all other settings are OK): # 2) and maybe 9). # # If this server is a firewall, which should act like a proxy (no direct # routing between both networks), or you are an end-user connected to the # internet and to an internal network, you have to setup your proxys and # reconfigure (all other settings are OK): 2), 3), 9) and maybe 7), 11), 14) # # If this server is a firewall, and should do routing/masquerading between # the untrusted and the trusted network, you have to reconfigure (all other # settings are OK): 2), 3), 5), 6), 9), and maybe 7), 10), 11), 12), 13), # 14) # # If you want to run a DMZ in either of the above three standard setups, you # just have to configure *additionally* 4), 9), 12), 13), 18) # # Please note that if you use service names, they have to exist in # /etc/services. There is for example no service "dns", it's called # "domain"; email is called "smtp" etc. # # ------------------------------------------------------------------------ ## Path: Network/Firewall/SuSEfirewall2 ## Description: SuSEfirewall2 configuration ## Type: string ## Default: any # # 2.) # Which are the interfaces that point to the internet/untrusted # networks? # # Enter all untrusted network devices here # # Format: space separated list of interface or configuration names # # The special keyword "any" means that packets arriving on interfaces not # explicitly configured as int, ext or dmz will be considered external. Note: # this setting only works for packets destined for the local machine. If you # want forwarding or masquerading you still have to add the external interfaces # individually. "any" can be mixed with other interface names. # # Examples: "ippp0 ippp1", "any dsl0" # # Note: alias interfaces (like eth0:1) are ignored # FW_DEV_EXT="eth0" ## Type: string # # 3.) # Which are the interfaces that point to the internal network? # # Enter all trusted network interfaces here. If you are not # connected to a trusted network (e.g. you have just a dialup) leave # this empty. # # Format: space separated list of interface or configuration names # # Examples: "tr0", "eth0 eth1" # FW_DEV_INT="eth1" ## Type: string # # 4.) # Which are the interfaces that point to the dmz or dialup network? # # Enter all the network devices here which point to the dmz/dialups. # A "dmz" is a special, seperated network, which is only connected # to the firewall, and should be reachable from the internet to # provide services, e.g. WWW, Mail, etc. and hence is at risk from # attacks. See /usr/share/doc/packages/SuSEfirewall2/EXAMPLES for an # example. # # Note: You have to configure FW_FORWARD to define the services # which should be available to the internet and set FW_ROUTE to yes. # # Format: space separated list of interface or configuration names # # Examples: "tr0", "eth0 eth1" # FW_DEV_DMZ="" ## Type: yesno ## Default: no # # 5.) # Should routing between the internet, dmz and internal network be # activated? # # Set this to "yes" if you either want to masquerade internal # machines or allow access to the dmz (or internal machines, but # this is not a good idea). # # This option overrides IP_FORWARD from # /etc/sysconfig/network/options # # Setting this option one alone doesn't do anything. Either activate # masquerading with FW_MASQUERADE below if you want to masquerade # your internal network to the internet, or configure FW_FORWARD to # define what is allowed to be forwarded. You also need to define # internal or dmz interfaces in FW_DEV_INT or FW_DEV_DMZ. # # defaults to "no" if not set # FW_ROUTE="yes" ## Type: yesno ## Default: no # # 6.) # Do you want to masquerade internal networks to the outside? # # Requires: FW_DEV_INT or FW_DEV_DMZ, FW_ROUTE, FW_MASQ_DEV # # "Masquerading" means that all your internal machines which use # services on the internet seem to come from your firewall. Please # note that it is more secure to communicate via proxies to the # internet than to use masquerading. # # This option is required for FW_MASQ_NETS and FW_FORWARD_MASQ. # # defaults to "no" if not set # FW_MASQUERADE="yes" ## Type: string ## Default: zone:ext # # 6a.) # You also have to define on which interfaces to masquerade on. # Those are usually the same as the external interfaces. Most users # can leave the default. # # The special string "zone:" concatenated with the name of a zone # means to take all interfaces in the specified zone. # # Old version of SuSEfirewall2 used a shell variable ($FW_DEV_EXT) # here. That method is deprecated as it breaks auto detection of # interfaces. Please use zone:ext instead. # # Examples: "ippp0", "zone:ext" # FW_MASQ_DEV="zone:ext" ## Type: string ## Default: 0/0 # # Which internal computers/networks are allowed to access the # internet via masquerading (not via proxys on the firewall)? # # Format: space separated list of # <source network>[,<destination network>,<protocol>[,port[:port]] # # If the protocol is icmp then port is interpreted as icmp type # # Examples: - "0/0" unrestricted access to the internet # - "10.0.0.0/8" allows the whole 10.0.0.0 network with # unrestricted access. # - "10.0.1.0/24,0/0,tcp,80 10.0.1.0/24,0/0,tcp,21" allows # the 10.0.1.0 network to use www/ftp to the internet. - # - "10.0.1.0/24,0/0,tcp,1024:65535 10.0.2.0/24" the # 10.0.1.0/24 network is allowed to access unprivileged # ports whereas 10.0.2.0/24 is granted unrestricted # access. # - "0/0,!10.0.0.0/8" unrestricted access to the internet # with the exception of 10.0.0.8 which will not be # masqueraded. # FW_MASQ_NETS="10.0.0.0/8" ## Type: string ## Default: 0/0 # # Which computers/networks should be excluded from beeing masqueraded? # Note that this only affects the POSTROUTING chain of the nat # table. Ie the forwarding rules installed by FW_MASQ_NETS do not # include the listed exceptions. # *** Since you may use FW_NOMASQ_NETS together with IPsec make sure # that the policy database is loaded even when the tunnel is not up # yet. Otherwise packets to the listed networks will be forwarded to # the internet unencrypted! *** # # Format: space separated list of # <source network>[,<destination network>,<protocol>[,port[:port]] # # If the protocol is icmp then port is interpreted as icmp type # # Examples: - "0/0,10.0.0.0/8" do not masquerade packets from # anywhere to the 10.0.0.0/8 network # FW_NOMASQ_NETS="" ## Type: yesno ## Default: no # # 7.) # Do you want to protect the firewall from the internal network? # Requires: FW_DEV_INT # # If you set this to "yes", internal machines may only access # services on the firewall you explicitly allow. If you set this to # "no", any internal user can connect (and attack) any service on # the firewall. # # defaults to "yes" if not set # # see also FW_REJECT_INT # FW_PROTECT_FROM_INT="no" ## Type: string # # 9.) # Which TCP services _on the firewall_ should be accessible from # untrusted networks? # # Enter all ports or known portnames below, seperated by a space. # TCP services (e.g. SMTP, WWW) must be set in FW_SERVICES_*_TCP, and # UDP services (e.g. syslog) must be set in FW_SERVICES_*_UDP. # e.g. if a webserver on the firewall should be accessible from the internet: # FW_SERVICES_EXT_TCP="www" # e.g. if the firewall should receive syslog messages from the dmz: # FW_SERVICES_DMZ_UDP="syslog" # For IP protocols (like GRE for PPTP, or OSPF for routing) you need to set # FW_SERVICES_*_IP with the protocol name or number (see /etc/protocols) # # Format: space separated list of ports, port ranges or well known # service names (see /etc/services) # # Examples: "ssh", "123 514", "3200:3299", "ftp 22 telnet 512:514" # FW_SERVICES_EXT_TCP="http smtp" ## Type: string # # Which UDP services _on the firewall_ should be accessible from # untrusted networks? # # see comments for FW_SERVICES_EXT_TCP # # Example: "53" # FW_SERVICES_EXT_UDP="bootpc" ## Type: string # # Which UDP services _on the firewall_ should be accessible from # untrusted networks? # # Usually for VPN/Routing which END at the firewall # # Example: "esp" # FW_SERVICES_EXT_IP="" ## Type: string # # Which RPC services _on the firewall_ should be accessible from # untrusted networks? # # Port numbers of RPC services are dynamically assigned by the # portmapper. Therefore "rpcinfo -p localhost" has to be used to # automatically determine the currently assigned port for the # services specified here. # # USE WITH CAUTION! # regular users can register rpc services and therefore may be able # to have SuSEfirewall2 open arbitrary ports # # Example: "mountd nfs" FW_SERVICES_EXT_RPC="" ## Type: string # # Which services _on the firewall_ should be accessible from # untrusted networks? # # Packages can drop a configuration file that specifies all required # ports into /usr/share/SuSEfirewall2/services . That is handy for # services that require multiple ports or protocols. Enter the space # separated list of configuration files you want to load. # # Example: "samba-server nfs-server" FW_CONFIGURATIONS_EXT="" ## Type: string # # see comments for FW_SERVICES_EXT_TCP FW_SERVICES_DMZ_TCP="" ## Type: string # # see comments for FW_SERVICES_EXT_UDP FW_SERVICES_DMZ_UDP="" ## Type: string # # see comments for FW_SERVICES_EXT_IP FW_SERVICES_DMZ_IP="" ## Type: string # # see comments for FW_SERVICES_EXT_RPC FW_SERVICES_DMZ_RPC="" ## Type: string # # see comments for FW_CONFIGURATIONS_EXT FW_CONFIGURATIONS_DMZ="" ## Type: string # # see comments for FW_SERVICES_EXT_TCP FW_SERVICES_INT_TCP="" ## Type: string # # see comments for FW_SERVICES_EXT_UDP FW_SERVICES_INT_UDP="" ## Type: string # # see comments for FW_SERVICES_EXT_IP FW_SERVICES_INT_IP="" ## Type: string # # see comments for FW_SERVICES_EXT_RPC FW_SERVICES_INT_RPC="" ## Type: string # # see comments for FW_CONFIGURATIONS_EXT FW_CONFIGURATIONS_INT="" ## Type: string # # Packets to silently drop without log message # # Format: space separated list of net,protocol[,port][,sport] # Example: "0/0,tcp,445 0/0,udp,4662" # # The special value _rpc_ is recognized as protocol and means that dport is # interpreted as rpc service name. See FW_SERVICES_EXT_RPC for # details. # FW_SERVICES_DROP_EXT="" ## Type: string ## Default: 0/0,tcp,113 # # Packets to silently reject without log message. Common usage is # TCP port 113 which if dropped would cause long timeouts when # sending mail or connecting to IRC servers. # # Format: space separated list of net,protocol[,dport][,sport] # Example: "0/0,tcp,113" # # The special value _rpc_ is recognized as protocol and means that dport is # interpreted as rpc service name. See FW_SERVICES_EXT_RPC for # details. # FW_SERVICES_REJECT_EXT="0/0,tcp,113" ## Type: string ## Default: # # Services to allow. This is a more generic form of FW_SERVICES_{IP,UDP,TCP} # and more specific than FW_TRUSTED_NETS # # Format: space separated list of net,protocol[,dport[,sport[,flags]]] # Example: "0/0,tcp,22" # # Supported flags are # hitcount=NUMBER : ipt_recent --hitcount parameter # blockseconds=NUMBER : ipt_recent --seconds parameter # recentname=NAME : ipt_recent --name parameter # Example: # Allow max three ssh connects per minute from the same IP address: # "0/0,tcp,22,,hitcount=3,blockseconds=60,recentname=ssh" # # The special value _rpc_ is recognized as protocol and means that dport is # interpreted as rpc service name. See FW_SERVICES_EXT_RPC for # details. # FW_SERVICES_ACCEPT_EXT="" ## Type: string # # 10.) # Which services should be accessible from 'trusted' hosts or nets? # # Define trusted hosts or networks (doesn't matter whether they are internal or # external) and the services (tcp,udp,icmp) they are allowed to use. This can # be used instead of FW_SERVICES_* for further access restriction. Please note # that this is no replacement for authentication since IP addresses can be # spoofed. Also note that trusted hosts/nets are not allowed to ping the # firewall until you also permit icmp. # # Format: space separated list of network[,protocol[,port]] # in case of icmp, port means the icmp type # # Example: "172.20.1.1 172.20.0.0/16 1.1.1.1,icmp 2.2.2.2,tcp,22" # FW_TRUSTED_NETS="" ## Type: string ## Default: # # 11.) # Specify which ports are allowed to access unprivileged ports (>1023) # # Format: yes, no or space separated list of ports # # You may either allow everyone from anyport access to your highports ("yes"), # disallow anyone ("no"), anyone who comes from a defined port (portnumber or # known portname). Note that this is easy to circumvent! The best choice is to # keep this option unset or set to 'no' # # defaults to "no" if not set (good choice) # # Note: Use of this variable is deprecated and it will likely be # removed in the future. If you think it should be kept please # report your use case at # http://forge.novell.com/modules/xfmod/project/?susefirewall2 # FW_ALLOW_INCOMING_HIGHPORTS_TCP="" ## Type: string ## Default: # # See FW_ALLOW_INCOMING_HIGHPORTS_TCP # # defaults to "no" if not set (good choice) # # Note: Use of this variable is deprecated and it will likely be # removed in the future. If you think it should be kept please # report your use case at # http://forge.novell.com/modules/xfmod/project/?susefirewall2 # FW_ALLOW_INCOMING_HIGHPORTS_UDP="" ## Type: string # # 13.) # Which services or networks are allowed to be routed through the # firewall, no matter which zone they are in? # Requires: FW_ROUTE # # With this option you may allow access to e.g. your mailserver. The # machines must have valid, non-private, IP addresses which were # assigned to you by your ISP. This opens a direct link to the # specified network, so please think twice befor using this option! # # Format: space separated list of # <source network>,<destination network>[,protocol[,port[,flags]]] # # If the protocol is icmp then port is interpreted as icmp type # # The only flag currently supported is 'ipsec' which means to only # match packets that originate from an IPsec tunnel # # Examples: - "1.1.1.1,2.2.2.2" allow the host 1.1.1.1 to access any # service on the host 2.2.2.2 # - "3.3.3.3/16,4.4.4.4/24" allow the network 3.3.3.3/16 # to access any service in the network 4.4.4.4/24 # - "5.5.5.5,6.6.6.6,igmp" allow routing of IGMP messages # from 5.5.5.5 to 6.6.6.6 # - "0/0,0/0,udp,514" always permit udp port 514 to pass # the firewall # - "192.168.1.0/24,10.10.0.0/16,,,ipsec \ # 10.10.0.0/16,192.168.1.0/24,,,ipsec" permit traffic # from 192.168.1.0/24 to 10.10.0.0/16 and vice versa # provided that both networks are connected via an # IPsec tunnel. # - "fd76:9dbb:91a3:1::/64,fd76:9dbb:91a3:4::/64,tcp,ssh" # allow ssh from one IPv6 network to another # FW_FORWARD="" ## Type: string # # 13a.) # # same as FW_FORWARD but packages are rejected instead of accepted # # Requires: FW_ROUTE # FW_FORWARD_REJECT="" ## Type: string # # 13b.) # # same as FW_FORWARD but packages are dropped instead of accepted # # Requires: FW_ROUTE # FW_FORWARD_DROP="" ## Type: string # # 14.) # Which services accessed from the internet should be allowed to masqueraded # servers (on the internal network or dmz)? # Requires: FW_ROUTE # # With this option you may allow access to e.g. your mailserver. The # machines must be in a masqueraded segment and may not have public # IP addesses! Hint: if FW_DEV_MASQ is set to the external interface # you have to set FW_FORWARD from internal to DMZ for the service as # well to allow access from internal! # # Please note that this should *not* be used for security reasons! # You are opening a hole to your precious internal network. If e.g. # the webserver there is compromised - your full internal network is # compromised! # # Format: space separated list of # <source network>,<ip to forward to>,<protocol>,<port>[,redirect port,[destination ip]] # # Protocol must be either tcp or udp # # Examples: - "4.0.0.0/8,10.0.0.10,tcp,80" forward all tcp request on # port 80 coming from the 4.0.0.0/8 network to the # internal server 10.10.0.10 # - "4.0.0.0/8,10.0.0.10,tcp,80,81" forward all tcp request on # port 80 coming from the 4.0.0.0/8 network to the # internal server 10.10.0.10 on port 81 # - "200.200.200.0/24,10.0.0.10,tcp,80,81,202.202.202.202" # the network 200.200.200.0/24 trying to access the # address 202.202.202.202 on port 80 will be forwarded # to the internal server 10.0.0.10 on port 81 # # Note: du to inconsitent iptables behaviour only port numbers are possible but # no service names (https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=273) # FW_FORWARD_MASQ="192.168.0.0/24,eth-eth0,tcp,0,0,0 192.168.0.0/24,eth-eth0,tcp,80" ## Type: string # # 15.) # Which accesses to services should be redirected to a local port on # the firewall machine? # # This option can be used to force all internal users to surf via # your squid proxy, or transparently redirect incoming webtraffic to # a secure webserver. # # Format: list of <source network>[,<destination network>,<protocol>[,dport[:lport]] # Where protocol is either tcp or udp. dport is the original # destination port and lport the port on the local machine to # redirect the traffic to # # An exclamation mark in front of source or destination network # means everything EXCEPT the specified network # # Example: "10.0.0.0/8,0/0,tcp,80,3128 0/0,172.20.1.1,tcp,80,8080" # # Note: contrary to previous SuSEfirewall2 versions it is no longer necessary # to additionally open the local port FW_REDIRECT="" ## Type: yesno ## Default: yes # # 16.) # Which kind of packets should be logged? # # When set to "yes", packages that got dropped and are considered # 'critical' will be logged. Such packets include for example # spoofed packets, tcp connection requests and certain icmp types. # # defaults to "yes" if not set # FW_LOG_DROP_CRIT="yes" ## Type: yesno ## Default: no # # whether all dropped packets should be logged # # Note: for broadcasts to be logged you also need to set # FW_IGNORE_FW_BROADCAST_* to 'no' # # defaults to "no" if not set # FW_LOG_DROP_ALL="no" ## Type: yesno ## Default: yes # # When set to "yes", packages that got accepted and are considered # 'critical' will be logged. Such packets include for example tcp # connection requests, rpc connection requests, access to high # udp/tcp port and forwarded pakets. # # defaults to "yes" if not set # FW_LOG_ACCEPT_CRIT="yes" ## Type: yesno ## Default: no # # whether all accepted packets should be logged # # Note: setting this to 'yes' causes _LOTS_ of log entries and may # fill your disk quickly. It also disables FW_LOG_LIMIT # # defaults to "no" if not set # FW_LOG_ACCEPT_ALL="no" ## Type: string # # How many packets per time unit get logged for each logging rule. # When empty a default of 3/minute is used to prevent port scans # flooding your log files. For desktop usage it's a good idea to # have the limit, if you are using logfile analysis tools however # you might want to disable it. # # Set to 'no' to disable the rate limit. Setting FW_LOG_ACCEPT_ALL # to 'yes' disables this option as well. # # Format: a digit and suffix /second, /minute, /hour or /day FW_LOG_LIMIT="" ## Type: string # # iptables logging option. Must end with --log-prefix and some prefix # characters # # You may specify an alternative logging target by starting the # string with "-j ". E.g. "-j ULOG --ulog-prefix SFW2" # # only change this if you know what you are doing! FW_LOG="" ## Type: yesno ## Default: yes # # 17.) # Do you want to enable additional kernel TCP/IP security features? # If set to yes, some obscure kernel options are set. # (icmp_ignore_bogus_error_responses, icmp_echoreply_rate, # icmp_destunreach_rate, icmp_paramprob_rate, icmp_timeexeed_rate, # ip_local_port_range, log_martians, rp_filter, routing flush, # bootp_relay, proxy_arp, secure_redirects, accept_source_route # icmp_echo_ignore_broadcasts, ipfrag_time) # # Tip: Set this to "no" until you have verified that you have got a # configuration which works for you. Then set this to "yes" and keep it # if everything still works. (It should!) ;-) # # Choice: "yes" or "no", if not set defaults to "yes" # FW_KERNEL_SECURITY="yes" ## Type: yesno ## Default: no # # 18.) # Keep the routing set on, if the firewall rules are unloaded? # REQUIRES: FW_ROUTE # # Choices "yes" or "no", if not set defaults to "no" # FW_STOP_KEEP_ROUTING_STATE="no" ## Type: yesno ## Default: yes # # 19.) # Allow the firewall to reply to icmp echo requests # # defaults to "no" if not set # FW_ALLOW_PING_FW="yes" ## Type: yesno ## Default: no # # 19a.) # Allow hosts in the dmz to be pinged from hosts in other zones even # if neither FW_FORWARD nor FW_MASQUERADE is set # # Requires: FW_ROUTE # # defaults to "no" if not set # FW_ALLOW_PING_DMZ="no" ## Type: yesno ## Default: no # # 19b.) # Allow hosts in the external zone to be pinged from hosts in other # zones even if neither FW_FORWARD nor FW_MASQUERADE is set # # Requires: FW_ROUTE # # defaults to "no" if not set # FW_ALLOW_PING_EXT="no" ## Type: yesno ## Default: yes # # 21.) # Allow ICMP sourcequench from your ISP? # # If set to yes, the firewall will notice when connection is choking, however # this opens yourself to a denial of service attack. Choose your poison. # # Defaults to "yes" if not set # FW_ALLOW_FW_SOURCEQUENCH="" ## Type: string(yes,no) # # 22.) # Allow IP Broadcasts? # # Whether the firewall allows broadcasts packets. # Broadcasts are used for e.g. for Netbios/Samba, RIP, OSPF and Games. # # If you want to drop broadcasts however ignore the annoying log entries, set # FW_IGNORE_FW_BROADCAST_* to yes. # # Note that if you allow specifc ports here it just means that broadcast # packets for that port are not dropped. You still need to set # FW_SERVICES_*_UDP to actually allow regular unicast packets to # reach the applications. # # Format: either # - "yes" or "no" # - list of udp destination ports # # Examples: - "631 137" allow broadcast packets on port 631 and 137 # to enter the machine but drop any other broadcasts # - "yes" do not install any extra drop rules for # broadcast packets. They'll be treated just as unicast # packets in this case. # - "no" drop all broadcast packets before other filtering # rules # # defaults to "no" if not set # FW_ALLOW_FW_BROADCAST_EXT="no" ## Type: string # # see comments for FW_ALLOW_FW_BROADCAST_EXT FW_ALLOW_FW_BROADCAST_INT="no" ## Type: string # # see comments for FW_ALLOW_FW_BROADCAST_EXT FW_ALLOW_FW_BROADCAST_DMZ="no" ## Type: string(yes,no) # # Suppress logging of dropped broadcast packets. Useful if you don't allow # broadcasts on a LAN interface. # # This setting only affects packets that are not allowed according # to FW_ALLOW_FW_BROADCAST_* # # Format: either # - "yes" or "no" # - list of udp destination ports # # Examples: - "631 137" silently drop broadcast packets on port 631 and 137 # - "yes" do not log dropped broadcast packets # - "no" log all dropped broadcast packets # # # defaults to "no" if not set FW_IGNORE_FW_BROADCAST_EXT="yes" ## Type: string # # see comments for FW_IGNORE_FW_BROADCAST_EXT FW_IGNORE_FW_BROADCAST_INT="no" ## Type: string # # see comments for FW_IGNORE_FW_BROADCAST_EXT FW_IGNORE_FW_BROADCAST_DMZ="no" ## Type: list(yes,no,int,ext,dmz,) ## Default: no # # 23.) # Specifies whether routing between interfaces of the same zone should be allowed # Requires: FW_ROUTE="yes" # # Set this to allow routing between interfaces in the same zone, # e.g. between all internet interfaces, or all internal network # interfaces. # # Caution: Keep in mind that "yes" affects all zones. ie even if you # need inter-zone routing only in the internal zone setting this # parameter to "yes" would allow routing between all external # interfaces as well. It's better to use # FW_ALLOW_CLASS_ROUTING="int" in this case. # # Choice: "yes", "no", or space separate list of zone names # # Defaults to "no" if not set # FW_ALLOW_CLASS_ROUTING="" ## Type: string # # 25.) # Do you want to load customary rules from a file? # # This is really an expert option. NO HELP WILL BE GIVEN FOR THIS! # READ THE EXAMPLE CUSTOMARY FILE AT /etc/sysconfig/scripts/SuSEfirewall2-custom # #FW_CUSTOMRULES="/etc/sysconfig/scripts/SuSEfirewall2-custom" FW_CUSTOMRULES="" ## Type: yesno ## Default: no # # 26.) # Do you want to REJECT packets instead of DROPing? # # DROPing (which is the default) will make portscans and attacks much # slower, as no replies to the packets will be sent. REJECTing means, that # for every illegal packet, a connection reject packet is sent to the # sender. # # Choice: "yes" or "no", if not set defaults to "no" # # Defaults to "no" if not set # # You may override this value on a per zone basis by using a zone # specific variable, e.g. FW_REJECT_DMZ="yes" # FW_REJECT="" ## Type: yesno ## Default: no # # see FW_REJECT for description # # default config file setting is "yes" assuming that slowing down # portscans is not strictly required in the internal zone even if # you protect yourself from the internal zone # FW_REJECT_INT="yes" ## Type: string # # 27.) # Tuning your upstream a little bit via HTB (Hierarchical Token Bucket) # for more information about HTB see http://www.lartc.org # # If your download collapses while you have a parallel upload, # this parameter might be an option for you. It manages your # upload stream and reserves bandwidth for special packets like # TCP ACK packets or interactive SSH. # It's a list of devices and maximum bandwidth in kbit. # For example, the german TDSL account, provides 128kbit/s upstream # and 768kbit/s downstream. We can only tune the upstream. # # Example: # If you want to tune a 128kbit/s upstream DSL device like german TDSL set # the following values: # FW_HTB_TUNE_DEV="dsl0,125" # where dsl0 is your pppoe device and 125 stands for 125kbit/s upstream # # you might wonder why 125kbit/s and not 128kbit/s. Well practically you'll # get a better performance if you keep the value a few percent under your # real maximum upload bandwidth, to prevent the DSL modem from queuing traffic in # it's own buffers because queing is done by us now. # So for a 256kbit upstream # FW_HTB_TUNE_DEV="dsl0,250" # might be a better value than "dsl0,256". There is no perfect value for a # special kind of modem. The perfect value depends on what kind of traffic you # have on your line but 5% under your maximum upstream might be a good start. # Everthing else is special fine tuning. # If you want to know more about the technical background, # http://tldp.org/HOWTO/ADSL-Bandwidth-Management-HOWTO/ # is a good start # FW_HTB_TUNE_DEV="" ## Type: list(no,drop,reject) ## Default: drop # # 28.) # What to do with IPv6 Packets? # # On older kernels ip6tables was not stateful so it's not possible to implement # the same features as for IPv4 on such machines. For these there are three # choices: # # - no: do not set any IPv6 rules at all. Your Host will allow any IPv6 # traffic unless you setup your own rules. # # - drop: drop all IPv6 packets. # # - reject: reject all IPv6 packets. This is the default if stateful matching is # not available. # # Disallowing IPv6 packets may lead to long timeouts when connecting to IPv6 # Adresses. See FW_IPv6_REJECT_OUTGOING to avoid this. # # Leave empty to automatically detect whether your kernel supports stateful matching. # FW_IPv6="" ## Type: yesno ## Default: yes # # 28a.) # Reject outgoing IPv6 Packets? # # Set to yes to avoid timeouts because of dropped IPv6 Packets. This Option # does only make sense with FW_IPv6 != no # # Defaults to "yes" if not set # FW_IPv6_REJECT_OUTGOING="" ## Type: list(yes,no,int,ext,dmz,) ## Default: no # # 29.) # Trust level of IPsec packets. # # You do not need to change this if you do not intend to run # services that should only be available trough an IPsec tunnel. # # The value specifies how much IPsec packets are trusted. 'int', 'ext' or 'dmz' # are the respective zones. 'yes' is the same as 'int. 'no' means that IPsec # packets belong to the same zone as the interface they arrive on. # # Note: you still need to explicitely allow IPsec traffic. # Example: # FW_IPSEC_TRUST="int" # FW_SERVICES_EXT_IP="esp" # FW_SERVICES_EXT_UDP="isakmp" # FW_PROTECT_FROM_INT="no" # # Defaults to "no" if not set # FW_IPSEC_TRUST="no" ## Type: string ## Default: # # 30.) # Define additional firewall zones # # The built-in zones INT, EXT and DMZ must not be listed here. Names # of additional zones must only contain lowercase ascii characters. # To define rules for the additional zone, take the approriate # variable for a built-in zone and substitute INT/EXT/DMZ with the # name of the additional zone. # # Example: # FW_ZONES="wlan" # FW_DEV_wlan="wlan0" # FW_SERVICES_wlan_TCP="80" # FW_ALLOW_FW_BROADCAST_wlan="yes" # FW_ZONES="" ## Type: list(yes,no,auto,) ## Default: # # 31.) # Whether to use iptables-batch # # iptables-batch commits all rules in an almost atomic way similar # to iptables-restore. This avoids excessive iptables calls and race # conditions. # # Choice: # - yes: use iptables-batch if available and warn if it isn't # - no: don't use iptables-batch # - auto: use iptables-batch if available, silently fall back to # iptables if it isn't # # Defaults to "auto" if not set # FW_USE_IPTABLES_BATCH="" ## Type: string ## Default: # # 32.) # Which additional kernel modules to load at startup # # Example: # FW_LOAD_MODULES="ip_conntrack_ftp ip_nat_ftp" # FW_LOAD_MODULES="" ## Type: string ## Default: # # 33.) # Bridge interfaces without IP address # # Traffic on bridge interfaces like the one used by xen appears to # enter and leave on the same interface. Add such interfaces here in # order to install special permitting rules for them. # # Format: list of interface names separated by space # # Example: # FW_FORWARD_ALWAYS_INOUT_DEV="xenbr0" # FW_FORWARD_ALWAYS_INOUT_DEV="" FW_SERVICES_ACCEPT_INT="" FW_SERVICES_ACCEPT_DMZ=""


Помогите пожалуйста!!! Если что то ещё нужно пишите я вышлю...
Да прибудет с вами connect...
Спасибо сказали:
Vovancheg
Сообщения: 41

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Vovancheg »

У Вас внутренний интерфейс SuSE какой адрес имеет? Из подсети 10.0.0.1/8? Если нет- то вполне логично не работает
Спасибо сказали:
Yara
Сообщения: 43
ОС: Linux SUSE 10.3;Windows XP SP2

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Yara »

Vovancheg писал(а):
23.02.2008 20:42
У Вас внутренний интерфейс SuSE какой адрес имеет? Из подсети 10.0.0.1/8? Если нет- то вполне логично не работает

192.168.0.1 На этот можно настроить ?? Я просто совсем не шарю....
Да прибудет с вами connect...
Спасибо сказали:
Vovancheg
Сообщения: 41

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Vovancheg »

Yara писал(а):
23.02.2008 20:57
Vovancheg писал(а):
23.02.2008 20:42
У Вас внутренний интерфейс SuSE какой адрес имеет? Из подсети 10.0.0.1/8? Если нет- то вполне логично не работает

192.168.0.1 На этот можно настроить ?? Я просто совсем не шарю....

А чего Вы таки хочете? Если у Вас внутренняя сеть 192.168.0.1/24, то в SuSEFirewall2 надо писать FW_MASQ_NETS="192.168.0.1/24" и будет Вам счастье! А попробуйте вместо 192.168.0.1/24 вписать дефолтный 0/0- и внимательно, очень внимательно читайте каменнты к параметпам- там всё довольно доходчиво разъяснено. Удачи!
Спасибо сказали:
Yara
Сообщения: 43
ОС: Linux SUSE 10.3;Windows XP SP2

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Yara »

Vovancheg писал(а):
24.02.2008 08:43
Yara писал(а):
23.02.2008 20:57
Vovancheg писал(а):
23.02.2008 20:42
У Вас внутренний интерфейс SuSE какой адрес имеет? Из подсети 10.0.0.1/8? Если нет- то вполне логично не работает

192.168.0.1 На этот можно настроить ?? Я просто совсем не шарю....

А чего Вы таки хочете? Если у Вас внутренняя сеть 192.168.0.1/24, то в SuSEFirewall2 надо писать FW_MASQ_NETS="192.168.0.1/24" и будет Вам счастье! А попробуйте вместо 192.168.0.1/24 вписать дефолтный 0/0- и внимательно, очень внимательно читайте каменнты к параметпам- там всё довольно доходчиво разъяснено. Удачи!


в обоих вариантах не работает. :wacko: ping не проходит пишеь узел не доступен
Да прибудет с вами connect...
Спасибо сказали:
Vovancheg
Сообщения: 41

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Vovancheg »

Тогда всё становится очень интересно!
Давайте, чистосердечно признавайтесь:
1. после изменений SuSEFirewall2, Вы его перезапускаете?
2. На самой Suse интернет есть?
3. Что именно не пингуется- сама Суся? Адреса в интернете? Что говорит nslookup?
4. И почему Вы руками стали править SuSEFirewall2? То, что Вы хотите легко настраивается из yast'а без всякого ручного вмешательства
Спасибо сказали:
Yara
Сообщения: 43
ОС: Linux SUSE 10.3;Windows XP SP2

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Yara »

Vovancheg писал(а):
24.02.2008 17:19
Тогда всё становится очень интересно!
Давайте, чистосердечно признавайтесь:
1. после изменений SuSEFirewall2, Вы его перезапускаете?
2. На самой Suse интернет есть?
3. Что именно не пингуется- сама Суся? Адреса в интернете? Что говорит nslookup?
4. И почему Вы руками стали править SuSEFirewall2? То, что Вы хотите легко настраивается из yast'а без всякого ручного вмешательства

Файрвол перезапускаю
На самой сюсе инет есть
Не пингуются адреса с клиентской машины, cюся пингуется
что такое nslook воще не знаю, но посмотрю обязательно
Руками править полез потому что то настраивал чере Яст - не заработало...
Или у меня руки кривые или что.........? :blush:
Да прибудет с вами connect...
Спасибо сказали:
Vovancheg
Сообщения: 41

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Vovancheg »

Yara писал(а):
24.02.2008 17:33
Vovancheg писал(а):
24.02.2008 17:19
Тогда всё становится очень интересно!
Давайте, чистосердечно признавайтесь:
1. после изменений SuSEFirewall2, Вы его перезапускаете?
2. На самой Suse интернет есть?
3. Что именно не пингуется- сама Суся? Адреса в интернете? Что говорит nslookup?
4. И почему Вы руками стали править SuSEFirewall2? То, что Вы хотите легко настраивается из yast'а без всякого ручного вмешательства

Файрвол перезапускаю
На самой сюсе инет есть
Не пингуются адреса с клиентской машины, cюся пингуется
что такое nslook воще не знаю, но посмотрю обязательно
Руками править полез потому что то настраивал чере Яст - не заработало...
Или у меня руки кривые или что.........? :blush:

Сдаётся мне, что дело не в сусе, но это уже оффтопик. Давайте дальше общаться через личные сообщения, пока нас не забанили... если хотите, конечно
Спасибо сказали:
YoRiKvs
Сообщения: 1
ОС: OpenSuse 10.2

Re: Статья по базовой настройке SuSEfirewall2

Сообщение YoRiKvs »

Доброе время суток!

Возник такой вопрос. Стоит Suse10.2
eth1 интернет с ip x.x.x.x
eth0 локалка с ip 192.168.1.x
pptpd сервер c адресом 192.168.1.х
клиентам выделяються адреса в том же диапазоне что и локалка!

При подключении клиента кроме сервера клиент не видет нечаго, при добавлении в FW_DEV_INT="eth0" параметра ppp0 (FW_DEV_INT="eth0 ppp0")
ВПН клиент начинает ходит в интернет, но не видет локалку!

Теперь сам вопрос. Что и где нада прописать в этом е..... SuseFirewall2 чтоб клиент увидел локалку?

Затык точно на уровне SuseFirewall2, так как при остановке его родимого и ручном запуске с нужными параметрами iptables, все начинает работать нормально.
Спасибо сказали:
Аватара пользователя
unreal
Сообщения: 30

Re: Статья по базовой настройке SuSEfirewall2

Сообщение unreal »

Итак в 11 сюзе в настройках SuSEfirewall2 появилось меню "Правила пользователя" :rolleyes:
Очень обрадовался увидев этот пункт... но рано радовался..
никак не мог понять логику этого меню- Сеть источника Протокол Порт назначения Порт источника... и в конце ожидалось увидеть "действие" типа- принять, отбросить и т.д., но "действия" не нашел...
присмотревшись внимательнее увидел что это меню не просто "Правила пользователя" а "Разрешенные правила пользователя"..
Но зачем же это меню если есть "Разрешенные службы "...?
Спасибо сказали:
skm
Сообщения: 1

Re: Статья по базовой настройке SuSEfirewall2

Сообщение skm »

Здравствуйте.

У меня интересная ситуация.
Поднят веб-сервер во внутренней сети (допустим 192.168.1.10, слушает порт 1).
Надо сделать, чтобы по одному имени (имя фаервола) на него цеплялись снаружи и изнутри.

FW_FORWARD_MASQ="0/0,192.168.1.10,tcp,1,1"

Написано, что для того чтобы изнутри также цеплялись надо прописать форвард

FW_FORWARD="192.168.1.0/24,ext_ip,tcp,1"


Снаружи заходит, изнутри нет. В чем подвох?
Спасибо сказали:
Аватара пользователя
Svolik
Сообщения: 23

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Svolik »

skm писал(а):
15.07.2008 08:39
Здравствуйте.

У меня интересная ситуация.
Поднят веб-сервер во внутренней сети (допустим 192.168.1.10, слушает порт 1).
Надо сделать, чтобы по одному имени (имя фаервола) на него цеплялись снаружи и изнутри.

FW_FORWARD_MASQ="0/0,192.168.1.10,tcp,1,1"

Написано, что для того чтобы изнутри также цеплялись надо прописать форвард

FW_FORWARD="192.168.1.0/24,ext_ip,tcp,1"


Снаружи заходит, изнутри нет. В чем подвох?

в матчасти роутинга :)
для этого веб-сервера всех локальных клиентов надо маскарадить на роутере на внутренний ip роутера. и будет щастье.
ЗЫ а вообще-то кошерным считается вынос такого веб-сервера в DMZ.
Спасибо сказали:
Аватара пользователя
ZuIf
Сообщения: 4
ОС: openSUSE

Re: Статья по базовой настройке SuSEfirewall2

Сообщение ZuIf »

Добрый день!
Третьи сутки бьюсь с прозрачным прокси, прозрачно ходит только по 80 порту, а порты 5190 и 443 например, не выпускает...
Система openSUSE 11, Squid 3.0

вот конфиг squid:

Код:

http_port 3128 transparent acl ICQ_DOMAIN dstdomain icq.com aol.com acl ICQ_ADDR dst 64.12.0.0/16 205.188.0.0/16 acl ICQ_PORT port 5190 #acl ICQ_PORT port 443 acl ICQ_PROTO proto HTTPS acl manager proto cache_object acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 acl home_lan src 192.168.1.0/24 acl bad_url url_regex "/etc/squid/bd/deny_url.conf" acl deny_domains dstdomain "/etc/squid/bd/deny_domains.conf" acl Safe_ports port 443 acl SSL_ports port 443 acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access allow Safe_ports http_access allow CONNECT SSL_ports http_access allow all ICQ_ADDR ICQ_PORT ICQ_PROTO CONNECT always_direct allow ICQ_DOMAIN ICQ_PORT CONNECT always_direct allow ICQ_ADDR ICQ_PORT CONNECT http_access deny home_lan deny_domains http_access deny home_lan bad_url http_access allow home_lan http_access allow localhost http_reply_access allow all icp_access allow home_lan icp_access deny all http_access deny all hierarchy_stoplist cgi-bin ? access_log /var/log/squid/access.log squid refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern (cgi-bin|\?) 0 0% 0 refresh_pattern . 0 20% 4320 cache_mgr webmaster httpd_suppress_version_string off visible_hostname proxy.home.lan icp_port 3130 error_directory /usr/share/squid/errors/Russian-1251 dns_nameservers 192.168.1.19 192.168.49.2 85.172.0.250 hosts_file /etc/hosts append_domain .home.lan forwarded_for off coredump_dir /var/cache/squid


конфиг SuSEfirewall2:

Код:

FW_DEV_EXT="any eth1" FW_DEV_INT="eth0" FW_DEV_DMZ="" FW_ROUTE="yes" FW_MASQUERADE="yes" FW_MASQ_DEV="zone:ext" FW_MASQ_NETS="192.168.1.0/24,0/0,tcp,80 192.168.1.0/24,0/0,tcp,443 192.168.1.0/24,0/0,tcp,5190" FW_NOMASQ_NETS="" FW_PROTECT_FROM_INT="no" FW_SERVICES_EXT_TCP="22 40000:40500 443 5190 61108 6881:6889 80 808 8080 8112 microsoft-ds netbios-ssn pop3 smtp" FW_SERVICES_EXT_UDP="netbios-dgm netbios-ns ntp" FW_SERVICES_EXT_IP="" FW_SERVICES_EXT_RPC="" FW_CONFIGURATIONS_EXT="apache2 vsftpd" FW_SERVICES_DMZ_TCP="" FW_SERVICES_DMZ_UDP="" FW_SERVICES_DMZ_IP="" FW_SERVICES_DMZ_RPC="" FW_CONFIGURATIONS_DMZ="" FW_SERVICES_INT_TCP="domain microsoft-ds netbios-ssn" FW_SERVICES_INT_UDP="domain netbios-dgm netbios-ns" FW_SERVICES_INT_IP="" FW_SERVICES_INT_RPC="mountd nfs nfs_acl nlockmgr portmap status" FW_CONFIGURATIONS_INT="kadmind kdc squid" FW_SERVICES_DROP_EXT="" FW_SERVICES_DROP_DMZ="" FW_SERVICES_DROP_INT="" FW_SERVICES_REJECT_EXT="" FW_SERVICES_REJECT_DMZ="" FW_SERVICES_REJECT_INT="" FW_SERVICES_ACCEPT_EXT="" FW_SERVICES_ACCEPT_DMZ="" FW_SERVICES_ACCEPT_INT="" FW_SERVICES_ACCEPT_RELATED_EXT="" FW_SERVICES_ACCEPT_RELATED_DMZ="" FW_SERVICES_ACCEPT_RELATED_INT="" FW_TRUSTED_NETS="" FW_ALLOW_INCOMING_HIGHPORTS_TCP="" FW_ALLOW_INCOMING_HIGHPORTS_UDP="" FW_FORWARD="" FW_FORWARD_REJECT="" FW_FORWARD_DROP="" FW_FORWARD_MASQ="" FW_REDIRECT="192.168.1.0/24,0/0,tcp,80,3128 192.168.1.0/24,0/0,tcp,443,3128 192.168.1.0/24,0/0,tcp,5190,3128" FW_LOG_DROP_CRIT="yes" FW_LOG_DROP_ALL="no" FW_LOG_ACCEPT_CRIT="yes" FW_LOG_ACCEPT_ALL="no" FW_LOG_LIMIT="" FW_LOG="" FW_KERNEL_SECURITY="yes" FW_STOP_KEEP_ROUTING_STATE="no" FW_ALLOW_PING_FW="yes" FW_ALLOW_PING_DMZ="no" FW_ALLOW_PING_EXT="no" FW_ALLOW_FW_SOURCEQUENCH="" FW_ALLOW_FW_BROADCAST_EXT="netbios-ns netbios-dgm ntp" FW_ALLOW_FW_BROADCAST_INT="netbios-ns netbios-dgm" FW_ALLOW_FW_BROADCAST_DMZ="" FW_IGNORE_FW_BROADCAST_EXT="yes" FW_IGNORE_FW_BROADCAST_INT="no" FW_IGNORE_FW_BROADCAST_DMZ="no" FW_ALLOW_CLASS_ROUTING="" FW_CUSTOMRULES="" FW_REJECT="" FW_REJECT_INT="yes" FW_HTB_TUNE_DEV="" FW_IPv6="no" FW_IPv6_REJECT_OUTGOING="no" FW_IPSEC_TRUST="no" FW_ZONES="" FW_USE_IPTABLES_BATCH="" FW_LOAD_MODULES="nf_conntrack_netbios_ns" FW_FORWARD_ALWAYS_INOUT_DEV="" FW_FORWARD_ALLOW_BRIDGING=""


Был бы очень благодарен за помощь в разрешении этой "загадки"
и жил он жил, пока не умер...
Спасибо сказали:
denqwerty
Сообщения: 1

Re: Статья по базовой настройке SuSEfirewall2

Сообщение denqwerty »

Не могу настроить две внутренние подсети((
есть внешний интерфейс и сеть xxxxx
есть зона dmz и сеть yyyyy
есть внутренняя сеть zzzzz
с недавних пор поставил еще одну сетевуху и заел еще одну внутреннюю подсеть nnnnn

беда в том, что не могу прописать сразу два сетевых интрефейса во внутреннюю подсеть..

подскажите как это попобороть?
Спасибо сказали:
Аватара пользователя
Evil_Genius
Сообщения: 92
ОС: Fedora

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Evil_Genius »

Подскажите пжлста, как можно заблокировать входящие соединения от сети 10.16.192.0/24 вообще или на определенные порты.
Спасибо сказали:
Teapot
Сообщения: 47
ОС: Suse 10.2

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Teapot »

Здравствуйте.

Мне понадобилось сделать так, чтобы при обращении к порту 139 подключение перебрасывалось на порт 1139. Не знаю, как правильно это назвать, не специалист в сетевых вопросах.
Есть образец правила для IPTables:

iptables -t nat -A PREROUTING -p tcp --dport 445 -j REDIRECT --to-ports 1445
iptables -t nat -A PREROUTING -p tcp --dport 139 -j REDIRECT --to-ports 1139
iptables -t nat -A PREROUTING -p udp --dport 137 -j REDIRECT --to-ports 1137
iptables -t nat -A PREROUTING -p udp --dport 138 -j REDIRECT --to-ports 1138

Используя то, что написано в файле конфигурационного файла Suse Firewall, я попробовал сделать так:

FW_FORWARD_MASQ="0/0,10.16.13.51,udp,138,1138 0/0,10.16.13.51,udp,137,1137 0/0,10.16.13.51,tcp,139,1139 0/0,10.16.13.15,tcp,445,1445"

Пробую:

telnet 10.16.13.51 139
Trying 10.16.13.51...
telnet: connect to address 10.16.13.51: Connection refused

/var/log/firewall

SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=00:21:5a:60:ea:6a:00:1c:c4:ad:43:f0:08:00 SRC=10.16.13.143 DST=10.16.13.51 LEN=48 TOS=0x00 PREC=0x00 TTL=128 ID=2257 DF PROTO=TCP SPT=9297 DPT=1139 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405B401010402)
SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=00:21:5a:60:ea:6a:00:1c:c4:ad:43:f0:08:00 SRC=10.16.13.143 DST=10.16.13.51 LEN=48 TOS=0x00 PREC=0x00 TTL=128 ID=2260 DF PROTO=TCP SPT=9297 DPT=1139 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405B401010402)
SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=00:21:5a:60:ea:6a:00:1c:c4:ad:43:f0:08:00 SRC=10.16.13.143 DST=10.16.13.51 LEN=48 TOS=0x00 PREC=0x00 TTL=128 ID=2266 DF PROTO=TCP SPT=9297 DPT=1139 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405B401010402)

Пробую непосредственно подключиться к порту 1139:

telnet 10.16.13.51 1139
Trying 10.16.13.51...
Connected to 10.16.13.51.

Получается, что организовать переброс портов у меня не получилось и как это сделать я не представляю.
Прошу вашего совета. Заранее большое спасибо.
Open Suse 11.0
Спасибо сказали:
Daire
Сообщения: 28
ОС: GNU/Linux

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Daire »

Что-бы заработал форвардинг, необходимо определить этот интерфейс принадлежащим "External zone"
Спасибо сказали:
Teapot
Сообщения: 47
ОС: Suse 10.2

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Teapot »

Спасибо за Ваш ответ.
Не подскажете, как это сделать? Повторяюсь, не спец в сетевых вопросах.
Open Suse 11.0
Спасибо сказали:
Аватара пользователя
Goodvin
Ведущий рубрики
Сообщения: 4333
Статус: ⚝⚠⚒⚑⚖☭☞☣☤&

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Goodvin »

Teapot писал(а):
19.03.2009 10:11
Спасибо за Ваш ответ.
Не подскажете, как это сделать? Повторяюсь, не спец в сетевых вопросах.
Вы в поиск уже ходили ?
Эта тема тут разжевана была уже много раз.
Для использования поиска никаким "спецом в вопросах" быть не надо, вполне достаточно обычного человеческого мозга.

Статья по базовой настройке SuSEfirewall2
Спасибо сказали:
Teapot
Сообщения: 47
ОС: Suse 10.2

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Teapot »

Гудвин, спасибо за ссылку. Пытаюсь так же понять Ваше раздражение, думаю, что оно связано с тем, что родились уже со знанием настройки фаервола, с чем Вас искренне поздравляю.
Указал в настроечном файле.
FW_DEV_EXT="any eth0"
FW_MASQ_DEV="zone:ext"
Фаервол перезапустил. Нулевой эффект.
Open Suse 11.0
Спасибо сказали:
Аватара пользователя
Goodvin
Ведущий рубрики
Сообщения: 4333
Статус: ⚝⚠⚒⚑⚖☭☞☣☤&

Re: Статья по базовой настройке SuSEfirewall2

Сообщение Goodvin »

Teapot писал(а):
19.03.2009 10:31
Гудвин, спасибо за ссылку. Пытаюсь так же понять Ваше раздражение, думаю, что оно связано с тем, что родились уже со знанием настройки фаервола, с чем Вас искренне поздравляю.
Если Вам среди буковок на страничке в браузере мерещится какое-то "раздражение" - это к доктору.


Teapot писал(а):
19.03.2009 10:31
Указал в настроечном файле.
FW_DEV_EXT="any eth0"
FW_MASQ_DEV="zone:ext"
Фаервол перезапустил. Нулевой эффект.
Зачем вы плодите темы про одно и то же ?
Попросите модератора этого раздела, чтобы он подклеил Вашу тему к уже существующей про настройку SuSeFirewall, и там пишите.
Осильте, наконец, правила форума:
2. Участник обязан:
2.2. Перед тем, как оставлять свои первые сообщения на форуме, внимательно ознакомиться с правилами форума, в который собирается писать своё сообщение, убедиться, что тема создаётся в форуме соответствующей тематики. Если Вы случайно ошиблись тематикой форума, попросите модераторов перенести тему в нужный раздел. Создание одинаковых тем в разных разделах расценивается как флуд.
2.3. Перед созданием новой темы убедиться, что подобная тема ещё не обсуждалась. Для этого использовать фильтр по названию и описанию темы, а также поиск.
Спасибо сказали:
DSS
Сообщения: 390

Re: Статья по базовой настройке SuSEfirewall2

Сообщение DSS »

Требуется разрешить достаточно большое количество сервисов через NAT наружу. Порты несмежные.
Дописывать в FW_MASQ_NETS неудобно - строка получается шибко длинная и смотреть плохо.

Вроде такого:
FW_MASQ_NETS="192.168.1.0/24,0/0,tcp,80 192.168.1.0/24,0/0,tcp,443 192.168.1.0/24,0/0,tcp,5190"

Можно ли как-то упростить?
Например, указать несколько параметров FW_MASQ_NETS подряд?
Примерно так:
FW_MASQ_NETS="192.168.1.0/24,0/0,tcp,80"
FW_MASQ_NETS="192.168.1.0/24,0/0,tcp,443"
FW_MASQ_NETS="192.168.1.0/24,0/0,tcp,5190"

И ещё - можно ли использовать в конфиге переменные?
Вроде такого: FW_MASQ_NETS="$MY_NET,0/0,tcp,$ICQ_PORT"
Спасибо сказали:
Аватара пользователя
shade1387
Сообщения: 146
ОС: Arch

Re: Статья по базовой настройке SuSEfirewall2

Сообщение shade1387 »

Посмотрите не на пункт 14), а на пункт 15) в настройках
FW_REDIRECT="0/0,0/0,tcp,1139,139" и т.п.
Спасибо сказали:
DSS
Сообщения: 390

Re: Статья по базовой настройке SuSEfirewall2

Сообщение DSS »

shade1387 писал(а):
19.03.2009 18:09
Посмотрите не на пункт 14), а на пункт 15) в настройках
FW_REDIRECT="0/0,0/0,tcp,1139,139" и т.п.

Это вообще не о том.
Это о перенаправлении проходящего через маршрутизатор трафика на локальный порт этого же маршрутизатора.
Классический пример - прозрачное проксирование - заворачивание всех пакетов, шурующих в интернет на 80, 443 и прочие порты, поддерживаемые Squid, на локальный порт 3128.

Отвечаю на собственные вопросы:
В: Например, указать несколько параметров FW_MASQ_NETS подряд?
О: Да, можно. Только yast2 после этого запускать категорически не рекомендуется - есть риск, что оставит вместо нескольких только один. Последний. :)

В: Можно ли использовать в конфиге переменные?
О: Да, можно. Использование - обычное. Создание "имя=значение", использование "$имя".
Спасибо сказали:
DSS
Сообщения: 390

Re: Статья по базовой настройке SuSEfirewall2

Сообщение DSS »

По предыдущему посту - в первом ответе написана неправда :)

Нельзя несколько параметров подряд указывать.
Будет воспринят только последний.
Только что проверено тщательным тестированием.
Спасибо сказали: