124b7 [Solved] multi subnet in NAT can't ping each other - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Networking

Networking Network related discussions (including general TCP/IP stuff, routing, etc).

Reply
 
Thread Tools Display Modes
  #1  
Old August 31st, 2010, 03:55
cheath cheath is offline
Junior Member
 
Join Date: Aug 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default multi subnet in NAT can't ping each other

I have a NAT server (PF) and 2 nics, one (fxp0) is public ip, and the other (fxp1) is private ip.
I bind 3 private ip on fxp1, 172.16.69.254, 172.16.70.254 and 172.16.71.254.
Clients are divided into 2 subnet, 172.16.70.0/24 and 172.16.71.0/24.
Clients and NAT server all connect to the same switch (no vlan).
Now, these two subnet can connect internet via NAT server, but clients can't ping (connect) the others in another subnet.
How can I do to let clients ping clients in another subnet?
Thanx.
Reply With Quote
  #2  
Old August 31st, 2010, 07:36
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,844
Thanks: 48
Thanked 2,060 Times in 1,890 Posts
Default

Please post your /etc/rc.conf and /etc/pf.conf.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old August 31st, 2010, 07:56
cheath cheath is offline
Junior Member
 
Join Date: Aug 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

FreeBSD 8.1-R

[/etc/rc.conf]
Code:
defaultrouter="140.xx.yy.126"
gateway_enable="YES"
ifconfig_fxp0="inet 140.xx.yy.5  netmask 255.255.255.128"
ifconfig_fxp1="inet 172.16.69.254  netmask 255.255.255.0"
ifconfig_fxp1_alias0="inet 172.16.70.254  netmask 255.255.255.0"
ifconfig_fxp1_alias1="inet 172.16.71.254  netmask 255.255.255.0"
pf_enable="YES"
pflog_enable="YES"
[/etc/pf.conf]
Code:
ext_if="fxp0"
int_if="fxp1"
wan_net = "140.xx.yy.0/25"
set skip on lo
scrub in all
nat on $ext_if from 172.16.70.0/24 to any -> 163.30.69.5
nat on $ext_if from 172.16.71.0/24 to any -> 163.30.69.5
Thanks.

Last edited by DutchDaemon; August 31st, 2010 at 10:12. Reason: proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #4  
Old August 31st, 2010, 07:57
mix_room mix_room is offline
Member
 
Join Date: Aug 2009
Posts: 500
Thanks: 9
Thanked 39 Times in 36 Posts
Default

http://www.freebsd.org/doc/handbook/...k-routing.html

Quote:
Originally Posted by Handbook - 31.2.4 Building a Router
31.2.4 Building a Router

A network router is simply a system that forwards packets from one interface to another. Internet standards and good engineering practice prevent the FreeBSD Project from enabling this by default in FreeBSD. You can enable this feature by changing the following variable to YES in rc.conf(5):

gateway_enable="YES" # Set to YES if this host will be a gateway

This option will set the sysctl(8) variable net.inet.ip.forwarding to 1. If you should need to stop routing temporarily, you can reset this to 0 temporarily.

Your new router will need routes to know where to send the traffic. If your network is simple enough you can use static routes. FreeBSD also comes with the standard BSD routing daemon routed(8), which speaks RIP (both version 1 and version 2) and IRDP. Support for BGP v4, OSPF v2, and other sophisticated routing protocols is available with the net/zebra package. Commercial products such as GateD® are also available for more complex network routing solutions.
Reply With Quote
  #5  
Old August 31st, 2010, 09:26
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,844
Thanks: 48
Thanked 2,060 Times in 1,890 Posts
Default

gateway_enable is already on or those clients wouldn't be able to access the internet either.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #6  
Old August 31st, 2010, 16:48
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,850
Thanks: 444
Thanked 1,827 Times in 1,494 Posts
Default

The NAT lines make no sense to me; what is 163.30.69.5?

Also, you don't mention the OS used by the clients, or whether you've tried tests other than ping. Some poorly-written OSes think ICMP packets are scary hacker tools, and firewall them.
Reply With Quote
  #7  
Old August 31st, 2010, 16:55
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,844
Thanks: 48
Thanked 2,060 Times in 1,890 Posts
Default

Run tcpdump(1) on the fxp0 interface and start pinging.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #8  
Old August 31st, 2010, 17:54
cheath cheath is offline
Junior Member
 
Join Date: Aug 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by wblock View Post
The NAT lines make no sense to me; what is 163.30.69.5?

Also, you don't mention the OS used by the clients, or whether you've tried tests other than ping. Some poorly-written OSes think ICMP packets are scary hacker tools, and firewall them.
sorry for copy and paste error. 163.30.69.5 should be replaced by ip bind on fxp0.
I use win2000 to ping win7. I ping clients on NAT server, too.
When I use win2000 to ping win7 in another subnet, no responds.
At the same time, I ping the same win7 client computer from NAT server, it responds.

I'll tcpdump it and post again, thanx.
Reply With Quote
  #9  
Old August 31st, 2010, 21:02
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,844
Thanks: 48
Thanked 2,060 Times in 1,890 Posts
Default

Have a look at netstat -rn too. Both networks should be accessable via fxp0.

You may also want to limit tcpdump to just show icmp:
# tcpdump -ni fxp0 icmp
Or just to/from a certain host:
# tcpdump -ni fxp0 icmp and host 172.16.70.12
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #10  
Old September 5th, 2010, 04:41
cheath cheath is offline
Junior Member
 
Join Date: Aug 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks wblock and SirDice.
I solved this problem.
It just win7 default only receives ping packet from the same subnet.
I edit firewall rules of win7 and it works fine.
Thanks a lot.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi domains with one nameserver sihaam Web & Network Services 3 August 5th, 2010 07:57
Multi-boot Problem esemesm Installing & Upgrading 4 July 1st, 2010 04:51
[Solved] Configure two NICs with same subnet tetelee Networking 2 May 4th, 2010 11:38
Multi-threaded BIND9? cpeterson General 1 April 28th, 2009 22:40
NAT: no NAT for local traffic mgp Networking 7 December 9th, 2008 22:27


All times are GMT +1. The time now is 23:50.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0