Skip to contentSkip to conversation

Iptables Make Rules On Different Interface? "iptables - L" shows no difference!

DISCUSSION ke chen 2 participants 2 messages Jun 6, 2004 – Jun 7, 2004

lore
Share & tools
lore

ke chen

author
#0 lore raw

hi all,
I want to make iptables impose different rules on two ethernet interfaces.

I would like to make restriction on external interface (eth0), but allow any traffic in and out of internal interface (eth1). iptables -A INPUT -i eth1 -s 0/0 -d 0/0 -j ACCEPT
iptables -A OUTPUT -o eth1 -s 0/0 -d 0/0 -j ACCEPT

when applying these rules, iptables -L
it shows
Chain INPUT (policy DROP)
target prot opt source destionation
Accept all -- anywhere anywhere

Chain OUTPUT (policy DROP)
target prot opt source destionation
Accept all -- anywhere anywhere

There is no place to differentiate interface eth0 or eth1

Anyone could give me some hints?

Thank you in advance.

BEST REGARDS
kurt

---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

#1 lore raw
Quoted 2 lines · ke chen

I want to make iptables impose different rules on two ethernet interfaces.

[...]

Quoted 5 lines

when applying these rules, iptables -L
it shows
Chain INPUT (policy DROP)
target prot opt source destionation
Accept all -- anywhere anywhere

You need to use the -v option, which causes iptables to show you the interface associated with a rule.

Ciao,
Sheldon.