PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : iptables und routing



linuxbaby
05.02.07, 17:28
Hi

folgende Situation, ich habe hier einen Server mit zwei Netzwerkkarten...normalerweise wird der Server nur mit einer karte betrieben, da dieser nun in ein anderes Netz bzw. rack ziehen soll, ist die 2te karte nun auch aktiviert, allerdings funtz dann auch ssh und ftp nicht mehr wirklich....ich denke das ist ein routing Problem....kann ich das nicht mit "iptables" lösen? Mein Ziel ist es das jeglicher traffic auf beiden Karten solange entgegen genommen wird wie nötig.....was braucht ihr für Infos....bin sehr blauägig was iptables angeht;)



Vielen dank für Eure Hilfe im voraus

mfg
linuxbaby

tschloss
05.02.07, 17:47
....bin sehr blauägig was iptables angeht;)


...nicht nur was iptables angeht ;)

Nix für ungut, aber du musst schon
a) das Problem genauer beschrieben ("...geht nicht wirklich..." ist etwas dünn)
b) die Situation ebenfalls (IP-Adressen der beiden Karten, wie sieht das Netz aus, von wo geht was/was nicht)

framp
05.02.07, 20:24
... ist die 2te karte nun auch aktiviert, allerdings funtz dann auch ssh und ftp nicht mehr wirklich....ich denke das ist ein routing Problem....kann ich das nicht mit "iptables" lösen?
Routing Probleme sind kein iptables Probleme. Bevor wir ständig hin und her fragen - poste mal den Output von dem Script (http://linux.framp.de/index.php/content/view/18/56/)

linuxbaby
06.02.07, 08:54
Hi

ich weiß, das die Angaben ein wenig dünn sind, wollte vorab aber wissen ob ich richtig liege, hier dann mal ein paar mehr angaben
ip_forward ist schonmal aktiviert, die netzkonfig der beiden karten

eth01


cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corp.|82547GI Gigabit Ethernet Controller
DEVICE=eth0
BOOTPROTO=none
BROADCAST=213.172.194.255
#HWADDR=00:30:48:82:3D:04
HWADDR=00:30:48:85:35:0A
IPADDR=213.172.194.53
NETMASK=255.255.254.0
NETWORK=213.172.194.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=no
GATEWAY=213.172.194.1
IPV6INIT=no


und die von eth1


# Intel Corp.|82547GI Gigabit Ethernet Controller
DEVICE=eth1
BOOTPROTO=none
BROADCAST=213.172.201.255
HWADDR=00:30:48:85:35:0B
IPADDR=213.172.201.248
NETMASK=255.255.255.192
NETWORK=213.172.201.192
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=no
#GATEWAY=213.172.201.193
IPV6INIT=no


iptables schaut derzeit so aus


iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
REJECT tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN reject-with tcp-reset
DROP all -- anywhere anywhere state INVALID
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp-data
ACCEPT tcp -- anywhere anywhere tcp dpt:8443
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
ACCEPT tcp -- river1.sw.ru anywhere tcp dpt:ssh
ACCEPT tcp -- support.sw-soft.com anywhere tcp dpt:ssh
ACCEPT tcp -- 80.89.128.178 anywhere tcp dpt:ssh
ACCEPT tcp -- gw-swsoft2.ll-nsk.zsttk.ru anywhere tcp dpt:ssh
ACCEPT tcp -- muedsl-82-207-252-174.citykom.de anywhere tcp dpt:ssh
ACCEPT tcp -- sw-soft.ac-tel.ru anywhere tcp dpt:ssh
ACCEPT tcp -- va-gw.swsoft.net anywhere tcp dpt:ssh
ACCEPT tcp -- 213.172.192.0/20 anywhere tcp dpt:ssh
DROP tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere tcp dpt:smtps
ACCEPT tcp -- anywhere anywhere tcp dpt:pop3
ACCEPT tcp -- anywhere anywhere tcp dpt:pop3s
ACCEPT tcp -- anywhere anywhere tcp dpt:imap
ACCEPT tcp -- anywhere anywhere tcp dpt:imaps
ACCEPT tcp -- anywhere anywhere tcp dpt:poppassd
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql
ACCEPT tcp -- anywhere anywhere tcp dpt:postgres
ACCEPT tcp -- anywhere anywhere tcp dpt:9008
ACCEPT tcp -- anywhere anywhere tcp dpt:9080
ACCEPT udp -- anywhere anywhere udp dpt:netbios-ns
ACCEPT udp -- anywhere anywhere udp dpt:netbios-dgm
ACCEPT tcp -- anywhere anywhere tcp dpt:netbios-ssn
ACCEPT tcp -- anywhere anywhere tcp dpt:microsoft-ds
ACCEPT udp -- anywhere anywhere udp dpt:1194
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT icmp -- anywhere anywhere icmp type 8 code 0
ACCEPT all -- anywhere anywhere

Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
REJECT tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN reject-with tcp-reset
DROP all -- anywhere anywhere state INVALID
ACCEPT all -- anywhere anywhere
ACCEPT udp -- sr7.rack15.ms.de.net anywhere
ACCEPT tcp -- sr7.rack15.ms.de.net anywhere
DROP all -- anywhere anywhere

Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
REJECT tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN reject-with tcp-reset
DROP all -- anywhere anywhere state INVALID
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere


Problem ist sobald ich sage "/sbin/ifup eth1" funzt der ftp und ssh aus dem 201er netz nicht zu der maschine. ftp von ausserhalb geht noch....
@framp dein script wird anscheinend gearde überarbeitet, deswegen diese ausgabe und @tschloss hab mich halt noch nie wirklich mit so einem "routing" bzw. iptables beschäftigen müssen, wie dem auch sei, ich hoffe nun ist es ein wenig klarer wo mein schuh drückt;)....und wenn ihr mehr angaben braucht, könnt ihr die selbstverfreilich auch bekommen....
Wäre nett wenn ihr mich ein wenig unterstützen könnt....

DANKE und gruss
linuxbaby

framp
06.02.07, 17:56
@framp dein script wird anscheinend gearde überarbeitet, deswegen diese ausgabe
Was für ein Problem hattest Du/Fehlermeldung mit dem Script denn das wichtigste - die Routen - fehlen in der Ausgabe.

Sag mal was das Problem beim Script war und poste noch die Ausgabe von 'route -n'

linuxbaby
06.02.07, 21:19
Hi

ich konnte das script nicht herunterladen :(



The document is being edited/updated by an user and is unavailable at this moment.


hier die ausgabe von route -n nur aktiviertes eth0


route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
213.172.194.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
0.0.0.0 213.172.194.1 0.0.0.0 UG 0 0 0 eth0


hier die ausgabe mit aktiviertem eth1



Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
213.172.201.192 0.0.0.0 255.255.255.192 U 0 0 0 eth1
213.172.194.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 213.172.194.1 0.0.0.0 UG 0 0 0 eth0

Ich frag mich wo die 169.245.0.0 ip herkommt?
Könnte das schon des rätsels löung seien? Bin für Hilfe dankbar!!!

MfG
linuxbaby