PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Linux Router



BIG_Nicky
21.08.03, 16:55
Eigentlich reicht es doch schon, wenn man die IP Weiterleitung an macht, und der Linux Rechner online ist, dann müsten doch eigentlich alle Clients den als gateway/DNS Server benutzen können, oder??? gibts da irgentwo nen howTo???

Sorry, ich bin n00b in sachen linux Routing, ich habs bis jetzt immer nur als Sever Betribsystem eingesetzt!:ugly:

Stage
21.08.03, 17:13
da nun fast jeder 2. Thread in diesem Forum um Routerbau geht kann ich dir URL schon auswendig *G*

http://www.linuxforen.de/forums/showthread.php?s=&threadid=60561&highlight=router+howto

BIG_Nicky
21.08.03, 17:22
thx, ich werd mal gucken...:)

BIG_Nicky
21.08.03, 17:46
Und da bin ich schon wieder...

Also Routing klapt super, aber das portforwarding was ich mit dem iptabels generator gemacht habe, funzt net, beim starten sachta auch nur "Unknown arg '--to-destination'


# NAT fuer EDONKEY
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 4661 -j DNAT --to-destination 192.168.0.2
iptables -t nat -A POSTROUTING -o eth0 -p tcp --dport 4661 -j SNAT --to-source $LAN_IP
iptables -A FORWARD -i ppp0 -m state --state NEW -p tcp -d 192.168.0.2 --dport 4661 -j ACCEPT
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 4662 -j DNAT --to-destination 192.168.0.2
iptables -t nat -A POSTROUTING -o eth0 -p tcp --dport 4662 -j SNAT --to-source $LAN_IP
iptables -A FORWARD -i ppp0 -m state --state NEW -p tcp -d 192.168.0.2 --dport 4662 -j ACCEPT
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 4663 -j DNAT --to-destination 192.168.0.2
iptables -t nat -A POSTROUTING -o eth0 -p tcp --dport 4663 -j SNAT --to-source $LAN_IP
iptables -A FORWARD -i ppp0 -m state --state NEW -p tcp -d 192.168.0.2 --dport 4663 -j ACCEPT
iptables -t nat -A PREROUTING -i ppp0 -p udp --dport 4665 -j DNAT --to-destination 192.168.0.2
iptables -t nat -A POSTROUTING -o eth0 -p udp --dport 4665 -j SNAT --to-source $LAN_IP
iptables -A FORWARD -i ppp0 -m state --state NEW -p udp -d 192.168.0.2 --dport 4665 -j ACCEPT

mctop
21.08.03, 18:17
lass mal das -destination weg

also

--to 192.xxx.xxx.xxx

burny
21.08.03, 18:43
die option "--to-destination" war schon richtig.

# man iptables



...
--to-destination ipaddr[-ipaddr][: port-port]
which can specify a single new destination IP address, an inclusive range of IP addresses, and
optionally, a port range (which is only valid if the rule also specifies -p tcp or -p udp).
If no port range is specified, then the destination port will never be modified.

BIG_Nicky
21.08.03, 21:01
Also nur so???

iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 4661 -j DNAT 192.168.0.2

Stage
22.08.03, 07:51
lass mal die ganzen SNAT regeln weg, weil das macht eh schon das Masquerading für dich

das --to-destination war schon richtig bei DNAT

formtapez
22.08.03, 08:08
das ist ein "iptables-generator" generiertes script oder ?

den fehler mit dem --to-destination hatte ich auch, aber in dem teil, den du gepostet hast (edonkey) kommt er nicht vor. irgendwo anders im script fehlt die IP hinter --to-destination

MfG
formtapez

BIG_Nicky
22.08.03, 10:06
öhm, jetzt blick ich nichtmer so gaz durch! Kann mir jemand nen beispiel für nen Port machen? :)

Stage
23.08.03, 08:48
also bei mir sieht das so aus für ED


iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 4662 -j DNAT --to-destination 192.168.0.1:4662
iptables -t nat -A PREROUTING -i ppp0 -p udp --dport 4672 -j DNAT --to-destination 192.168.0.1:4672

mehr nich, achja die Forward Chain steht per default auf Accept


iptables -P FORWARD ACCEPT