Results 1 to 3 of 3
Hi everyone,
I have a server which has 3 nic's in it with the following configuration:
eth2 192.168.1.2 to router 192.168.1.1
eth1 192.168.2.1 vlan 10
eth0 192.168.3.1 vlan 20
the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-08-2010 #1Just Joined!
- Join Date
- Jul 2009
- Location
- uk
- Posts
- 22
Need help fast with iptables
Hi everyone,
I have a server which has 3 nic's in it with the following configuration:
eth2 192.168.1.2 to router 192.168.1.1
eth1 192.168.2.1 vlan 10
eth0 192.168.3.1 vlan 20
the server can get the internet no problems, but i am trying to forward the traffic from both eth1 ,eth0 to eth2 and back again etc but i have tried a few peoples iptables scripts and they dont seem to work eg.
edit: ip forwarding is on to, and eth1 and eth0 have the gateway and dns of 192.168.1.1 router ipCode:#!/bin/sh IPT=/bin/iptables $IPT -F $IPT -P OUTPUT ACCEPT $IPT -P INPUT DROP $IPT -P FORWARD DROP $IPT -t nat -A POSTROUTING -o eth2 -j MASQUERADE $IPT -A FORWARD -i eth2 -o eth1 -m state ---state RELATED,ESTABLISHED -f ACCEPT $IPT -A FORWARD -i eth1 -o eth2 -j ACCEPT $IPT -A FORWARD -i eth2 -o eth0 -m state ---state RELATED,ESTABLISHED -f ACCEPT $IPT -A FORWARD -i eth0 -o eth2 -j ACCEPT
Can anyone tell me if i have done something wrong its doing my head in.
Many thanksLast edited by linuxfan27; 11-08-2010 at 08:18 PM.
- 11-09-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,141
School project?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 11-11-2010 #3Just Joined!
- Join Date
- Nov 2010
- Posts
- 4
i'm noob at linux but... dont you need enable forwarding ??
###Enable IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward


Reply With Quote
