-
Problema que nao consegui resolver - NAT
Seguinte: Detalhes da minha rede;
---INTERNET----
|
ROTEADOR 200.222.54.62
|
SERVIDOR > rede 1 = 200.222.54.2 (Válida)
> rede 2 = 10.10.1.10 (Invalida)
==========================================
Problema
-----------
Tenho 23 usuário na rede inválida que precisam navegar com IPs válidos
como farei para que os usuário que estão na rede invalida saiam para internet com IP válido, todos tem que ter IP diferente.
Estou a beira de um ataque de nervos...
Valeu
-
Problema que nao consegui resolver - NAT
ips diferentes?????? vc soh vai conseguir fazer isso se vc tb tiver varios ips validos..... se naum cada um vai sair com o mesmo ip
-
Problema que nao consegui resolver - NAT
Eu tenho 64 IPs válidos prontos para usar, só não sei como fazer
[]´s
-
Problema que nao consegui resolver - NAT
Simon sabe o que fala...
Simon loko é verdade...
Simon pergunta diz:
"Se vc tiver gateway linux pode utilizar o script abaixo para seu rc.firewall"
Obs: Este script usa tecnica de mascaramento de ip´s, portanto mtos travas de seguranças devem ser inseridas ou a invasão pode ocorrer sussegadamente.
Simon usar técnica complicada de cut em grud..."
#!/bin/sh
#
# rc.firewall-2.4
FWVER=0.63
#
# Initial SIMPLE IP Masquerade test for 2.4.x kernels
# using IPTABLES.
#
# Once IP Masquerading has been tested, with this simple
# ruleset, it is highly recommended to use a stronger
# IPTABLES ruleset either given later in this HOWTO or
# from another reputable resource.
#
#
#
# Log:
# 0.63 - Added support for the IRC IPTABLES module
# 0.62 - Fixed a typo on the MASQ enable line that used eth0
# instead of $EXTIF
# 0.61 - Changed the firewall to use variables for the internal
# and external interfaces.
# 0.60 - 0.50 had a mistake where the ruleset had a rule to DROP
# all forwarded packets but it didn´t have a rule to ACCEPT
# any packets to be forwarded either
# - Load the ip_nat_ftp and ip_conntrack_ftp modules by default
# 0.50 - Initial draft
#
echo -e "\n\nLoading simple rc.firewall version $FWVER..\n"
# The location of the ´iptables´ program
#
# If your Linux distribution came with a copy of iptables, most
# likely it is located in /sbin. If you manually compiled
# iptables, the default location is in /usr/local/sbin
#
# ** Please use the "whereis iptables" command to figure out
# ** where your copy is and change the path below to reflect
# ** your setup
#
IPTABLES=/sbin/iptables
#Setting the EXTERNAL and INTERNAL interfaces for the network
#
# Each IP Masquerade network needs to have at least one
# external and one internal network. The external network
# is where the natting will occur and the internal network
# should preferably be addressed with a RFC1918 private address
# scheme.
#
# For this example, "eth0" is external and "eth1" is internal"
#
# NOTE: If this doesnt EXACTLY fit your configuration, you must
# change the EXTIF or INTIF variables above. For example:
#
# EXTIF="ppp0"
#
# if you are a modem user.
#
EXTIF="eth0"
INTIF="eth1"
echo " External Interface: $EXTIF"
echo " Internal Interface: $INTIF"
#======================================================================
#== No editing beyond this line is required for initial MASQ testing ==
echo -en " loading modules: "
# Need to verify that all modules have all required dependencies
#
echo " - Verifying that all kernel modules are ok"
/sbin/depmod -a
# With the new IPTABLES code, the core MASQ functionality is now either
# modular or compiled into the kernel. This HOWTO shows ALL IPTABLES
# options as MODULES. If your kernel is compiled correctly, there is
# NO need to load the kernel modules manually.
#
# NOTE: The following items are listed ONLY for informational reasons.
# There is no reason to manual load these modules unless your
# kernel is either mis-configured or you intentionally disabled
# the kernel module autoloader.
#
# Upon the commands of starting up IP Masq on the server, the
# following kernel modules will be automatically loaded:
#
# NOTE: Only load the IP MASQ modules you need. All current IP MASQ
# modules are shown below but are commented out from loading.
# ===============================================================
#Load the main body of the IPTABLES module - "iptable"
# - Loaded automatically when the "iptables" command is invoked
#
# - Loaded manually to clean up kernel auto-loading timing issues
#
echo -en "ip_tables, "
/sbin/insmod ip_tables
#Load the IPTABLES filtering module - "iptable_filter"
# - Loaded automatically when filter policies are activated
#Load the stateful connection tracking framework - "ip_conntrack"
#
# The conntrack module in itself does nothing without other specific
# conntrack modules being loaded afterwards such as the "ip_conntrack_ftp"
# module
#
# - This module is loaded automatically when MASQ functionality is
# enabled
#
# - Loaded manually to clean up kernel auto-loading timing issues
#
echo -en "ip_conntrack, "
/sbin/insmod ip_conntrack
#Load the FTP tracking mechanism for full FTP tracking
#
# Enabled by default -- insert a "#" on the next line to deactivate
#
echo -en "ip_conntrack_ftp, "
/sbin/insmod ip_conntrack_ftp
#Load the IRC tracking mechanism for full IRC tracking
#
# Enabled by default -- insert a "#" on the next line to deactivate
#
echo -en "ip_conntrack_irc, "
/sbin/insmod ip_conntrack_irc
#Load the general IPTABLES NAT code - "iptable_nat"
# - Loaded automatically when MASQ functionality is turned on
#
# - Loaded manually to clean up kernel auto-loading timing issues
#
echo -en "iptable_nat, "
/sbin/insmod iptable_nat
#Loads the FTP NAT functionality into the core IPTABLES code
# Required to support non-PASV FTP.
#
# Enabled by default -- insert a "#" on the next line to deactivate
#
echo -en "ip_nat_ftp, "
/sbin/insmod ip_nat_ftp
# Just to be complete, here is a list of the remaining kernel modules
# and their function. Please note that several modules should be only
# loaded by the correct master kernel module for proper operation.
# --------------------------------------------------------------------
#
# ipt_mark - this target marks a given packet for future action.
# This automatically loads the ipt_MARK module
#
# ipt_tcpmss - this target allows to manipulate the TCP MSS
# option for braindead remote firewalls.
# This automatically loads the ipt_TCPMSS module
#
# ipt_limit - this target allows for packets to be limited to
# to many hits per sec/min/hr
#
# ipt_multiport - this match allows for targets within a range
# of port numbers vs. listing each port individually
#
# ipt_state - this match allows to catch packets with various
# IP and TCP flags set/unset
#
# ipt_unclean - this match allows to catch packets that have invalid
# IP/TCP flags set
#
# iptable_filter - this module allows for packets to be DROPped,
# REJECTed, or LOGged. This module automatically
# loads the following modules:
#
# ipt_LOG - this target allows for packets to be
# logged
#
# ipt_REJECT - this target DROPs the packet and returns
# a configurable ICMP packet back to the
# sender.
#
# iptable_mangle - this target allows for packets to be manipulated
# for things like the TCPMSS option, etc.
echo ". Done loading modules."
#CRITICAL: Enable IP forwarding since it is disabled by default since
#
# Redhat Users: you may try changing the options in
# /etc/sysconfig/network from:
#
# FORWARD_IPV4=false
# to
# FORWARD_IPV4=true
#
echo " enabling forwarding.."
echo "1" > /proc/sys/net/ipv4/ip_forward
# Dynamic IP users:
#
# If you get your IP address dynamically from SLIP, PPP, or DHCP,
# enable this following option. This enables dynamic-address hacking
# which makes the life with Diald and similar programs much easier.
#
echo " enabling DynamicAddr.."
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
# Enable simple IP forwarding and Masquerading
#
# NOTE: In IPTABLES speak, IP Masquerading is a form of SourceNAT or SNAT.
#
# NOTE #2: The following is an example for an internal LAN address in the
# 192.168.0.x network with a 255.255.255.0 or a "24" bit subnet mask
# connecting to the Internet on external interface "eth0". This
# example will MASQ internal traffic out to the Internet but not
# allow non-initiated traffic into your internal network.
#
#
# ** Please change the above network numbers, subnet mask, and your
# *** Internet connection interface name to match your setup
#
#Clearing any previous configuration
#
# Unless specified, the defaults for INPUT and OUTPUT is ACCEPT
# The default for FORWARD is DROP
#
echo " clearing any existing rules and setting default policy.."
# By Marcos
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -t nat -F
echo " FWD: Allow all connections OUT and only existing and related ones IN"
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -A FORWARD -j LOG
echo " Enabling SNAT (MASQUERADE) functionality on $EXTIF"
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s 192.168.0.2/32 -j MASQUERADE
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s 192.168.0.3/32 -j MASQUERADE
#$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s 192.168.0.4/32 -j MASQUERADE
#$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s 192.168.0.5/32 -j MASQUERADE
#$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s 192.168.0.6/32 -j MASQUERADE
#$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s 192.168.0.7/32 -j MASQUERADE
#$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s 192.168.0.8/32 -j MASQUERADE
#$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s 192.168.0.9/32 -j MASQUERADE
echo -e "\nDone.\n"
# End by Simon
##################################################
ACABOU AGORA COPIE E COLE.
Simon diz:
"Se ajudar isso... verificar IP´s e eth0 e eth1."
-
Problema que nao consegui resolver - NAT
Dúvidas...
Como cada cliente terá o IP válido atriuido a ele??? Tipo.... Como o usuário do ip 10.10.1.21 terá o ip válido 200.243.168.30?
[]´s
-
Problema que nao consegui resolver - NAT
Simon pergunta pra Sábio:
"Vc tem um gateway fazendo o serviço de roteamento?"
Vide DIAGRAMA:
[eth0] <------> roteador/rc.firewall <------> [eth1]
DHCP ip-fixo - para todas maquinas
fornecido cada maquina da rede deve ser
pelo seu configurada com ip fixos.
servidor de internet 192.168.0.X vc pode alterar p/
10.10.1.X cada maquina da rede
interna deve ser acrescentada
no final.
#!TODAS AS MAQUINAS INTERNAS (ABAIXO GATEWAY)
#DEVEM TER IP FIXOS ATRIBUÍDOS.
#CADA UMA DEFINIDA INDIVIDUALMENTE, NO SEU CASO O FINAL
# DO ARQUIVO RC.FIREWALL SERIA:
echo " Enabling SNAT (MASQUERADE) functionality on $EXTIF"
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s 10.10.1.2/32 -j MASQUERADE
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s 10.10.1.3/32 -j MASQUERADE
# E ASSIM SEGUE PRA CADA UMA MAQUINA DA REDE
-
Problema que nao consegui resolver - NAT
OK...
Qual será o IP que o usuário 10.10.1.3/32 sairá para a Internet?
-
Problema que nao consegui resolver - NAT
para fazer com q cada ip interno seja alterado vc vai precisar fazer isso:
iptables -t nat -A POSTROUTING -s IP_INTERNO1 -j SNAT --to IP_VALIDO1
iptables -t nat -A POSTROUTING -s IP_INTERNO2 -j SNAT --to IP_VALIDO2
.
.
.
etc....
-
Problema que nao consegui resolver - NAT
veja como ficou as minhas regras de IPTABLES:
-----------
Checking for Firewall: Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere
LOG all -- anywhere anywhere LOG level warning
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT all -- 10.10.10.2 anywhere to:200.243.54.16
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
-------------
Observacoes:
A maquina que esta com o firewall esta com a seguintes configuracoes
================================================================
---- Placa de Rede externa eth0 = 200.243.54.11
---- Placa de Rede interna eth1 = 10.10.10.1
---- Gateway = 200.243.54.62
A maquina que esta na rede 10.0.0.0
=================================
---- Placa de Rede eth0 = 10.10.10.2
---- Gateway = 10.10.10.1
E mesmo assim a maquina 10.10.10.2 nao esta indo pra internet com o ip 200.243.54.16
... Qual sera o problema?
-
Problema que nao consegui resolver - NAT
o problema deve ser esse:
Chain FORWARD (policy DROP)
coloca ai iptables -P FORWARD ACCEPT
-
Problema que nao consegui resolver - NAT
Coloquei a CHAIN e ainda nada!
-
Problema que nao consegui resolver - NAT
Bom pessoal com do jeito antigo nao deu estou tentando assim:
(((((--Servidor - INTERNET--)))))
=----Placa de rede ETH0 = 200.243.54.11
=----Placa de rede ETH1 = 200.243.168.20
=---- Gateway = 200.243.54.62 -- Roteador PR4000 onde estao as classe de IPs 168 e 54 declaradas
((--Maquina Cliente--))
=---- Placa de rede ETH0 = 200.243.168.21
=---- Gateway = 200.243.168.20
==== ESSA E A MINHA TABELA DE ROTEAMENTO ====
Tabela de Roteamento IP do Kernel
Destino---------Roteador---------MáscaraGen.-----Opções---Métrica---Ref----Uso---Iface
200.243.168.0 * 255.255.255.192 U 0 0 0 eth1
200.243.54.0 * 255.255.255.192 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 200.243.54.62 0.0.0.0 UG 0 0 0 eth0
Nesse novo esquema eu nao estou utilizando nenhuma regra de firewall! Mais mesmo assim o computador que esta com o IP = 200.243.168.21 nao consegue ir para a Internet.
Deve utilizar alguma regra de firewall??? Penso eu que so a tabela de ROTEAMENTO resolveria...
Me ajudem!?!?!?!
<IMG SRC="images/forum/icons/icon_eek.gif">
-
Problema que nao consegui resolver - NAT
-
Problema que nao consegui resolver - NAT
falae sumido....
infelizmente num ta sendo tao simples assim...
to falando com o colega pelo icq...
-
Problema que nao consegui resolver - NAT
Kra vc tb pode configurar um a brigde transparente para pode passar estes ips para sua rede interna.
-
Problema que nao consegui resolver - NAT
faça isso
esterna = eth0 - 200.222.54.2
interna = eth1 - 10.10.1.10
iptables -P FORWARD -j DROP
iptables -A FORWARD -s 10.10.1.0/24 -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.10.1.0/24 -o eth0 -j SNAT --to 200.222.54.2
isto é o suficiente para o rotiamento...
detalhe - o gateway do seu linux é o roteador
e não se esqueça de configurar as maquina windows , configuração de rede, gateway coloque o ip do server linux - 10.10.1.10 e na parte de DNS coloque o DNS do provedor
espero ter ajudado
-
Problema que nao consegui resolver - NAT
cara jah falei q num eh tao simples assim,
ele tem um roteador na frente do linux e depois o linux faz o rotemento interno.....
e outra TUDO EH IP VALIDO
-
Problema que nao consegui resolver - NAT
On 2003-01-09 16:04, Leyzem wrote:
faça isso
esterna = eth0 - 200.222.54.2
interna = eth1 - 10.10.1.10
iptables -P FORWARD -j DROP
iptables -A FORWARD -s 10.10.1.0/24 -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.10.1.0/24 -o eth0 -j SNAT --to 200.222.54.2
isto é o suficiente para o rotiamento...
detalhe - o gateway do seu linux é o roteador
e não se esqueça de configurar as maquina windows , configuração de rede, gateway coloque o ip do server linux - 10.10.1.10 e na parte de DNS coloque o DNS do provedor
espero ter ajudado
há e não se esqueça de colocar digitar
echo "1" > /proc/sys/net/ipv4/ip_forward
<IMG SRC="images/forum/icons/icon_biggrin.gif"> <IMG SRC="images/forum/icons/icon_wink.gif">
-
Problema que nao consegui resolver - NAT
Tente isso
esterna = eth0 - 200.222.54.2
interna = eth1 - 10.10.1.10
iptables -P FORWARD -j DROP
iptables -A FORWARD -s 10.10.1.0/24 -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.10.1.0/24 -o eth0 -j SNAT --to 200.222.54.2
isto é o suficiente para o rotiamento...
detalhe - o gateway do seu linux é o roteador
e não se esqueça de configurar as maquina windows , configuração de rede, gateway coloque o ip do server linux - 10.10.1.10 e na parte de DNS coloque o DNS do provedor
espero ter ajudado
há e não se esqueça de colocar digitar
echo "1" > /proc/sys/net/ipv4/ip_forward
<IMG SRC="images/forum/icons/icon_biggrin.gif"> <IMG SRC="images/forum/icons/icon_wink.gif">
-
Problema que nao consegui resolver - NAT
soh vou falar uma coisa.........
leia as msgs anteriores antes de falar..
-
Problema que nao consegui resolver - NAT
Se aprenderem a postar msgs de uma maneira legível, ou até mesmas perguntas que dá para se entender, ai pode ser que sim... <IMG SRC="images/forum/icons/icon_mad.gif">
-
Problema que nao consegui resolver - NAT
Simon diz:
"Complicam coisas fáceis de entender... interface entre teclado e cadeira está com erro de dll (destesto ler lixux).... resolvendo isso resolve tudo."
-
Problema que nao consegui resolver - NAT
o loko Simon erro de dll naum eh, eh pelo menos erro de dependencia hehehe
e Leyzem como disse antes todos os ips que o red october tem são validos.... e vc fica postando mascaramento de rede inválida... numa adianta nda neh.. <IMG SRC="images/forum/icons/icon_razz.gif"> <IMG SRC="images/forum/icons/icon_razz.gif"> <IMG SRC="images/forum/icons/icon_razz.gif">
e mais uma coisa.. vc postou a MESMA msg 3 vezes...
[ Esta mensagem foi editada por: 1c3_m4n em 09-01-2003 17:16 ]
[ Esta mensagem foi editada por: 1c3_m4n em 09-01-2003 17:17 ]
-
Problema que nao consegui resolver - NAT
Simon ri...
<IMG SRC="images/forum/icons/icon_biggrin.gif">
falta package então...
falta lib então...
Caminho único, tão pouco obscuro...
instale as libs e as dependências serão satisfeitas...
rpm -Uvh --force lib*.rpm
-
Problema que nao consegui resolver - NAT
hehehe agora as dependencias jah foram sanadas....
Simon:
Cara a um tempo atraz eu postei uma msgs pedindo pra vc postar as falhas de segurança do PUTTY e vc num respondeu <IMG SRC="images/forum/icons/icon27.gif"> ai apareceram alguma que eu fiquei sabendo....
tem mais alguma?????
bom o problema do amigo red october foi quase totalmente resolvido, ta tudo funcionando agora ele quer que os micros q estao atras do server linux q está atraz de um PR4000 saia com o ip da propria maquina e não o IP do servidor que eh o q acontece qdo se usa o MASQUERADE... não lembro como eh q se faz isso, soh fiz uma vez na vida e foi com o routed... alguem tem algum material bom pra isso????
-
Problema que nao consegui resolver - NAT
Simon diz:
Vc não leu o final do rc.firewall ?
A caracteristica básica do mesmo é para rede de ip´s fixos.
Tá bem... já que vc sabe tanto resolva de vez o problema de nosso amigo.
Aliás vc sabe mesmo... e por isso frequento aki...
Simon precisa da sua ajuda:
Como fazer para ter 3 versões de linux diferente (RH,Debian,Mandrake e Connectiva dentro do mesmo lilo... pode ser grub ?
Agradeço antecipadamente.
-
Problema que nao consegui resolver - NAT
final do rc.firewall?? vc diz akela parte do SNAT --to 200. blablabla? akilo num funciona naum....
jah testamos a tarde inteira isso....
qto aos linux da sim e pelo q vc falou ai sao 4 e naum 3 neh? hehehe
mas eu acho q seria melhor vc usar o LILO doq o GRUB.... num confio mto nele naum
se vc quiser mesmo usar o GRUB vc vai ter q editar o arquivo /boot/grub/menu.lst e editar ele... mas se num me engano vc talvez nem tenha q mexer em nda, eh soh vc instalar todos eles com o lilo ou o grub na MBR ai qdo vc instalar o ultimo deles ele vai reconhecer todos os outros e montar o arquivo certinho
-
Problema que nao consegui resolver - NAT
Simon diz:
blz!!!
valeu... estou usando lilo...
por equanto consegui startar 3 partições ... mas a partição com Debian dá dor de cabeça...
Realmente tive que inserir o local das partições na unha...
Vou ter q compilar o kernel do debian.... com algumas opções que removam a checagem de disco... isso ficou complicado...
AH Assim... estou curioso pra ver o final da resolução do problema do nosso amigo.
Valeu t+!!!
-
Problema que nao consegui resolver - NAT
Bom galera... Estou muito agradecido pela a atenção que estão me dando! Principalmente a do 1c3_m4n que ficou a tarde toda tentando solucionar o problema.
O mesmo ainda está sem solução!
Aos que se habilitam sou todos ouvidos.
Valeu e conto com a ajuda de vcs
[]`s
-
Problema que nao consegui resolver - NAT
SIMON:
pq vc num instala o debian por ultimo e deixa o lilo dele ser o gerenciador? achoq ai vai resolver seu problema!!!
REDOCTOBER:
akeles links q te passei sobre o routed, vc chegou a testar alguma coisa?
-
Problema que nao consegui resolver - NAT
Eu so tinha dado uma olhada mais superficial, depois encontrei esse documento e passei a analizar mais...
http://focalinux.cipsga.org.br/guia/...tm#s-rede-rota
De uma olhada e me fala o que vc acha
T+
-
Problema que nao consegui resolver - NAT
a cara eu acho q num eh bem por ai não.....
olha nesses links aki q tem bastante coisa
http://www.google.com.br/search?q=co...TF-8&hl=pt&lr=
-
Problema que nao consegui resolver - NAT
Fala 1c3_m4n...
Cara, ainda não consegui resolver esse problema!!!
<IMG SRC="images/forum/icons/icon_mad.gif">