From: <ber...@em...> - 2006-04-07 14:26:48
|
Hello, my Linux machine has one physical interface eth0 and additionally one logically interface eth0:1 : linux-develop:/usr/share/doc/ifupdown/examples# ifconfig -a eth0 Link encap:Ethernet HWaddr 00:50:BA:EE:B4:35 inet addr:192.168.255.25 Bcast:192.168.255.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:34819 errors:0 dropped:0 overruns:0 frame:0 TX packets:33864 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:5948119 (5.6 MiB) TX bytes:3104279 (2.9 MiB) Interrupt:10 Base address:0xb400 eth0:1 Link encap:Ethernet HWaddr 00:50:BA:EE:B4:35 inet addr:192.168.255.81 Bcast:192.168.255.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:10 Base address:0xb400 Jetty binds itself to port 8080 for the logically interface eth0:1 and I now want to add the right iptables rule to redirect port 80 to port 8080 for eth0:1. It is important that port 80 for eth0 is not redirected. What is the correct rule here? I tried /sbin/iptables -t nat -I PREROUTING -p tcp --dst 192.168.255.81 --dport 80 -j REDIRECT --to-port 8080 and /sbin/iptables -t nat -I PREROUTING -p tcp -i eth0:1 --dport 80 -j REDIRECT --to-port 8080 but without success. Who can help me here? Thanks in advance, Bernd |