All of lore.kernel.org
 help / color / mirror / Atom feed
* again problem with alias / virtual interface
@ 2004-07-19 18:55 Batstru
  2004-07-19 19:10 ` George Alexandru Dragoi
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Batstru @ 2004-07-19 18:55 UTC (permalink / raw)
  To: netfilter

Hi all!
I wrote days ago: I have a problem with virutal interface and iptables:
my pc has 2 network interface, one with a private network address and the
other one with 
public network addresses:
eth0 --> 192.168.1.254 / 255.255.255.0
eth1 --> 82.186.92.90 / 255.255.255.248
eth1:1 --> 82.186.92.91 / 255.255.255.248
eth1:2 --> 82.186.92.92 / 255.255.255.248
eth1:3 --> 82.186.92.93 / 255.255.255.248
eth1:4 --> 82.186.92.93 / 255.255.255.248
I have configured network with ifconfig and route
iptables has this filter rules:
*filter
:FORWARD DROP [0:0]
:INPUT DROP [0:0]
:OUTPUT DROP [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state -i eth0 --state NEW -j ACCEPT
-A INPUT -s 192.168.1.0 -i eth0 -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.90 --dport 22 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.90 --dport 80 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.90 --dport 143 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.90 --dport 10000
--state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.90 --dport 25 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.90 --dport 110 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.91 --dport 20 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.91 --dport 21 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.91 --dport 22 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1:1 -d 82.186.92.91 --dport 25 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.91 --dport 53 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.91 --dport 80 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.91 --dport 110 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.91 --dport 143 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.91 --dport 443 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.93 --dport 20 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.93 --dport 21 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.93 --dport 22 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.93 --dport 25 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.93 --dport 80 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.93 --dport 110 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.93 --dport 143 --state
NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth1 -d 82.186.92.93 --dport 8888 --state
NEW -j ACCEPT
as you can see I've tried changing configuration but anything changes: it is
reported just a 
warning but the rule is not applied.
-A INPUT -p tcp -m tcp -m state -i eth1:1 -d 82.186.92.91 --dport 25 --state
NEW -j ACCEPT
My pc is running Fedora core 2 and the kernel is 2.6.6 and I've just
upgraded iptables to last 
release.


The problem is that I can't access to services running at virtual
interfaces. 
I tried to solve the problem as suggested me: I've seen that using alias is
deprecated so I 
tried using iproute: I set up with 
ip addr add 82.186.92.90/24 brd 82.186.92.95 dev eth1 label eth1:0
ip addr add 82.186.92.91/24 brd 82.186.92.95 dev eth1 label eth1:1
ip addr add 82.186.92.92/24 brd 82.186.92.95 dev eth1 label eth1:2
ip addr add 82.186.92.93/24 brd 82.186.92.95 dev eth1 label eth1:3
ip addr add 82.186.92.94/24 brd 82.186.92.95 dev eth1 label eth1:4
but after service iptables restart anything changes, alias's rules doesn't
be applied and no 
errors is reported. 
I think I'm doing something wrong with iproute but I don't know what: shoud
I give any command 
to enable iproute?

My problem is quite strange, I've never seen such....


tnks 
marco 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Conto Arancio. Zero spese, stessa banca, più interessi.
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=657&d=20040719




^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: again problem with alias / virtual interface
@ 2004-07-21 10:31 Batstru
  2004-07-21 17:09 ` Aleksandar Milivojevic
  0 siblings, 1 reply; 20+ messages in thread
From: Batstru @ 2004-07-21 10:31 UTC (permalink / raw)
  To: Netfilter User Mailinglist

Thanks you for suggestion but I shoud have another kind of problem. I think
my problem isn't on rules but over somewhere else: as Antony Stone wrote I
tryed "iptables -L INPUT -nvx" to see if I get zero packets counts and the
answer of a telnet 82.186.92.91 25 is 
[root@maya root]# iptables -L INPUT -nvx
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- eth1 * 0.0.0.0/0 82.186.92.91 tcp dpt:25 state
NEW,ESTABLISHED
0 0 ACCEPT icmp -- eth1 * 0.0.0.0/0 82.186.92.90
0 0 ACCEPT icmp -- eth1 * 0.0.0.0/0 82.186.92.93
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
and if I ping 82.186.92.90
[root@maya root]# iptables -L INPUT -nvx
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
9 790 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 168 ACCEPT icmp -- eth1 * 0.0.0.0/0 82.186.92.90
I can see that the icmp rule 
iptables -A INPUT -p icmp -i eth1 -d 82.186.92.90 -j ACCEPT
works but the rule
-A INPUT -i eth1 -p tcp -d 82.186.92.90 --dport 22 
-m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -o eth1 -p tcp -s 82.186.92.90 --sport 22 
-m state --state ESTABLISHED -j ACCETP
is applied but I have zero packets count.
So I tryed with tcpdump: I log into anoher pc and I telnet 82.186.92.91 25.
At local host I 
try:
[root@maya root]# tcpdump -i eth1 | grep
host91-92.pool82186.interbusiness.it
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
11:31:41.895811 IP bella.dei.unipd.it.52242 >
host91-92.pool82186.interbusiness.it.smtp: S 
891791967:891791967(0) win 24820 <nop,nop,sackOK,mss 1460>
11:31:45.257887 IP bella.dei.unipd.it.52242 >
host91-92.pool82186.interbusiness.it.smtp: S 
891791967:891791967(0) win 24820 <nop,nop,sackOK,mss 1460>
11:31:52.006557 IP bella.dei.unipd.it.52242 >
host91-92.pool82186.interbusiness.it.smtp: S 
891791967:891791967(0) win 24820 <nop,nop,sackOK,mss 1460>
190 packets captured
291 packets received by filter
0 packets dropped by kernel
I can see that the just the first packet arrives but anything leave my host.
I don't know why... 
So I can't understand why with telnet 82.186.92.91 25 iptables -L INPUT -nvx
detect that any 
packet is dropped and anypacket is accepted by the rule. Where packets go?
I have also seen that iproute configurtion is correct with 
ip addr show dev eth1
with the anser
3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:40:f4:62:38:fd brd ff:ff:ff:ff:ff:ff
    inet 82.186.92.90/29 brd 82.186.92.95 scope global eth1
    inet 82.186.92.91/29 brd 82.186.92.95 scope global secondary eth1:1
    inet 82.186.92.92/29 brd 82.186.92.95 scope global secondary eth1:2
    inet 82.186.92.93/29 brd 82.186.92.95 scope global secondary eth1:3
    inet 82.186.92.94/29 brd 82.186.92.95 scope global secondary eth1:4

best regards
marco


--------- Original Message --------
Da: "Aleksandar Milivojevic" <amilivojevic@pbl.ca>
To: "Netfilter User Mailinglist" <netfilter@lists.netfilter.org>
Oggetto: Re: again problem with alias / virtual interface
Data: 20/07/04 21:25

Aleksandar Milivojevic wrote:
[snip]
> -A INPUT -i eth1 -p tcp -d 82.186.92.90 --dport 22 
> -m state --state NEW,ESTABLISHED
> -A OUTPUT -o eth1 -p tcp -s 82.186.92.90 --sport 22 
> -m state --state ESTABLISHED
> -A INPUT -i eth1 -p icmp -d 82.186.92.90 -m state --state RELATED
> -A OUTPUT -o eth1 -p icmp -s 82.186.92.90 -m state --state RELATED
I forgot "-j ACCEPT" in all of the above. Sorry for the omission...
-- 
Aleksandar Milivojevic <amilivojevic@pbl.ca> Pollard Banknote Limited
Systems Administrator 1499 Buffalo Place
Tel: (204) 474-2323 ext 276 Winnipeg, MB R3T 1L7 
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Vuoi completare i tuoi studi?
Cepu offre una soluzione di insegnamento individuale e personalizzato
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2617&d=20040721 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 18 Bottiglie di eccellenti vini Giordano + 7 specialità alimentari +
1 batteria di pentole da 10 pezzi in acciaio Tutto a metà prezzo!

 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2625&d=20040721




^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2004-07-22 16:58 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-19 18:55 again problem with alias / virtual interface Batstru
2004-07-19 19:10 ` George Alexandru Dragoi
2004-07-19 16:17   ` Marco Strullato
2004-07-19 19:14 ` Antony Stone
2004-07-19 19:35 ` Aleksandar Milivojevic
2004-07-19 16:30   ` Marco Strullato
2004-07-20 19:09     ` Antony Stone
2004-07-20 19:12     ` Aleksandar Milivojevic
2004-07-20 19:22       ` Aleksandar Milivojevic
2004-07-21 15:34     ` Marco Colombo
2004-07-21 16:48       ` Michael Sconzo
2004-07-21 17:13         ` Aleksandar Milivojevic
2004-07-22  2:27           ` Michael Sconzo
2004-07-22 16:58             ` Aleksandar Milivojevic
2004-07-22  8:53           ` Marco Colombo
2004-07-22 16:05             ` Michael Sconzo
2004-07-19 19:46 ` Jamie Pratt
2004-07-19 19:58   ` Antony Stone
  -- strict thread matches above, loose matches on Subject: below --
2004-07-21 10:31 Batstru
2004-07-21 17:09 ` Aleksandar Milivojevic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.