(E-Mail Removed) wrote:
> Possibly that you are right, I just tried to do the command Gimickser
> told me, with small tweakings and it didn't work.
>
> First it complains that my kernel may not support NAT, might need to
> recompile it or load it, etc...
>
> Second, there was something strange in my host, if I do `ifconfig -a` I
> will get a listing of 4 interfaces. The usual 'lo', then there was
> 'venet0' where the ip was 127.0.0.1, then 'venet0:0' with ip address
> IP1 and 'venet0:1' with ip address IP2.
>
> If I use the interface venet0:1, iptables complains that the interface
> cannot contain a colon ":"... i guess I may have to contact my
> sys.admins or is there a way for me to deal this myself?
>
> Thanks!
> xm
>
The most examples use DNAT for this matter, i don't know why. But the
following rules actually should work. Maybe the REDIRECT target will
also work, but i am not sure, just google around and you'll find the
right rules.
I also don't know, how to handle the devices. Did you try "venet0:1"?
If it doesn't work, maybe there is a possibility to create aliases for
these devices.
iptables -t nat -A PREROUTING -p tcp -i "venet0:2" -d IP2 --dport 80 -j
DNAT --to host:22
iptables -A FORWARD -p tcp -i "venet0:1" -d IP2 --dport 80 -m state
NEW,RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -p tcp -m state RELATED,ESTABLISHED -j ACCEPT
Before load the following modules (if possible)?
modprobe ip_tables
modprobe iptable_filter
modprobe iptable_nat
modprobe ipt_state
modprobe ip_conntrack
greetz,
gimickser