Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.networking > #1254

Re: linux as multi-port (subnet) router using Ubuntu 11.10 server

From lincy <lincylin@gmail.com>
Newsgroups comp.os.linux.networking
Subject Re: linux as multi-port (subnet) router using Ubuntu 11.10 server
Date 2012-04-09 06:40 -0700
Organization http://groups.google.com
Message-ID <23753461.82.1333978858232.JavaMail.geo-discussion-forums@pbvy6> (permalink)
References (6 earlier) <jlsehl$2sf8$1@saria.nerim.net> <26518308.9.1333903498341.JavaMail.geo-discussion-forums@pbtd9> <jlsjd0$2u7i$1@saria.nerim.net> <13689836.1943.1333930427032.JavaMail.geo-discussion-forums@pbvs10> <jlu7ip$g2l$1@saria.nerim.net>

Show all headers | View raw


Pascal Hambourg於 2012年4月9日星期一UTC+8下午4時45分12秒寫道:
> lincy a écrit :
> > 
> > I have using tcpdump to listen eth1 (192.168.2.0) and eth2 (192.168.3.0),
> > I have saw the 192.168.3.51 have echo icmp request. But this package
> > only reach 192.168.3.1, not going to 192.168.2.1, so, 192.168.2.181
> > report time out.
> 
> Can you be more precise, or better, provide the output of tcpdump on
> both interfaces ?

Sorry, I was wrong. I was issue some iptable rule. To try and error. Then saw this result. But after clear all rule. It's little difference

Here is the tcpdump with no any iptable rule.

dump for eth1 (192.168.2.0)
21:00:36.593857 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56228, length 40
21:00:36.681668 IP 192.168.2.181.138 > 192.168.2.255.138: UDP, length 213
21:00:41.594273 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56229, length 40
21:00:46.592657 ARP, Request who-has 192.168.2.1 (00:60:e0:4e:f9:e1) tell 192.168.2.181, length 46
21:00:46.592676 ARP, Reply 192.168.2.1 is-at 00:60:e0:4e:f9:e1, length 28
21:00:46.593667 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56230, length 40
21:00:47.417978 IP 192.168.2.181.60120 > 192.168.1.11.161: UDP, length 78
21:00:51.593160 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56231, length 40
21:00:56.593645 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56232, length 40
21:00:58.391788 IP 192.168.2.181.60120 > 192.168.1.11.161: UDP, length 78
21:01:01.593176 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56233, length 40
21:01:06.593578 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56234, length 40
21:01:08.392724 IP 192.168.2.181.60120 > 192.168.1.11.161: UDP, length 78
21:01:11.594091 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56235, length 40
21:01:13.093096 ARP, Request who-has 192.168.2.1 (00:60:e0:4e:f9:e1) tell 192.168.2.181, length 46
21:01:13.093112 ARP, Reply 192.168.2.1 is-at 00:60:e0:4e:f9:e1, length 28
21:01:16.593682 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56236, length 40
21:01:19.315536 ARP, Request who-has 192.168.2.1 tell 192.168.2.181, length 46
21:01:19.315552 ARP, Reply 192.168.2.1 is-at 00:60:e0:4e:f9:e1, length 28
21:01:19.596954 IP 192.168.2.181.50952 > 239.255.255.250.1900: UDP, length 133
21:01:21.594124 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56237, length 40
21:01:22.597326 IP 192.168.2.181.50952 > 239.255.255.250.1900: UDP, length 133



dump for eth2:
21:00:36.457244 ARP, Request who-has 192.168.3.51 tell 192.168.51.1, length 28
21:00:36.457510 ARP, Reply 192.168.3.51 is-at 70:5a:b6:40:02:d5, length 46
21:00:36.593887 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56228, length 40
21:00:41.594300 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56229, length 40
21:00:46.593692 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56230, length 40
21:00:51.593187 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56231, length 40
21:00:56.593677 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56232, length 40
21:01:01.593200 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56233, length 40
21:01:06.593605 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56234, length 40
21:01:11.594113 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56235, length 40
21:01:16.593717 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56236, length 40
21:01:21.594152 IP 192.168.2.181 > 192.168.3.51: ICMP echo request, id 3, seq 56237, length 40


Ok, here is what I try...

iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -d 192.168.3.0/24 -j SNAT --to 192.168.3.1
iptables -t nat -A POSTROUTING -s 192.168.3.0/24 -d 192.168.2.0/24 -j SNAT --to 192.168.2.1

now can ping from 192.168.2.x to 192.168.3.x,  vice versa.
The strange thing is 192.168.3.x to 192.168.2.x SMB function ok, but 192.168.2.x to 192.168.3.x was not.....
Still trying ....


Back to comp.os.linux.networking | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-08 05:50 -0700
  Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2012-04-08 17:16 +0300
    Re: linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-08 08:26 -0700
      Re: linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-08 08:47 -0700
        Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2012-04-08 18:13 +0200
          Re: linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-08 09:24 -0700
            Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2012-04-08 18:31 +0200
              Re: linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-08 09:44 -0700
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2012-04-08 19:54 +0200
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-08 17:13 -0700
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2012-04-09 10:45 +0200
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-09 06:40 -0700
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2012-04-09 21:01 +0200
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-09 12:56 -0700
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2012-04-09 23:33 +0200
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2012-04-10 08:55 +0300
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-09 23:40 -0700
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2012-04-10 14:39 +0300
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-10 08:22 -0700
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2012-04-08 21:13 +0300
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2012-04-08 20:48 +0200
                Re: linux as multi-port (subnet) router using Ubuntu 11.10 server lincy <lincylin@gmail.com> - 2012-04-08 17:25 -0700

csiph-web