Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Sep 2009 10:08:57 -0400
From:      Steve Bertrand <steve@ibctech.ca>
To:        Freeco <freeco@inbox.lv>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: IPF, NAT or NIC
Message-ID:  <4AB39479.8090205@ibctech.ca>
In-Reply-To: <25508442.post@talk.nabble.com>
References:  <25491958.post@talk.nabble.com>	<20090917174950.GC34712@ei.bzerk.org>	<25504647.post@talk.nabble.com>	<200909180815.n8I8FpFS045063@banyan.cs.ait.ac.th>	<25507235.post@talk.nabble.com> <4AB37AE0.2070409@ibctech.ca> <25508442.post@talk.nabble.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a cryptographically signed message in MIME format.

--------------ms080901060202040402090300
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Freeco wrote:
> So it means that i will need 2 more NIC's in my gateway?
> 
> 				|---------<pc>
> 				|
> ISP>-----------<Gateway>-----<Switch>-----<pc>
> 				|
> 				|_________<pc>
> 
> Why all pc's can't be in one subnet? I'll be happy with one subnet,

Ok. One of us is confused, but I don't know who yet :)

A 'subnet' is a term used to describe a portion of an IP address space,
where each device in that space can communicate with one another without
using a router:

192.168.1.0/24 is a subnet, so hosts 192.168.1.1 through 192.168.1.254
can 'speak' to each other without using a router. If you have more than
one PC, you need a 'switch' or hub to physically connect all of those
devices, so they can all speak to each other. (fwiw, I cringe at the
term subnet).

In the diagram above, you need two NICs in the gateway. One goes to the
ISP, and the other 192.168.1.2 goes to the switch. The rest of the
computers also plug into the switch. If all of the devices have
192.168.1.x, they are all in the same subnet.

> i don't
> need more. I tried this:
> 
> ISP x.x.88.17>-----------<x.x.88.20 Gateway 192.168.1.2>----------<pc cable
> unplugged 192.168.1.7>?

You need what's known as a 'cross-over' cable to connect the PC to the
Gateway directly. The first sentence in this link describes it well:

http://en.wikipedia.org/wiki/Ethernet_crossover_cable


> I want to use this one:
>                                                                                           
> |---------<pc 192.168.1.5>
>                                                                                           
> |
> ISP x.x.88.17>-----------<x.x.88.20 Gateway
> 192.168.1.2>-----<Switch>-----<pc 192.168.1.6>
>                                                                                           
> |
>                                                                                           
> |_________<pc 192.168.1.7> 
> 

The diagram got mangled, but from what I can tell, this is the same as
the diagram I left at the top of this message.

> The gateway will work like firewall and nat. Maybe i have wrong settings on
> my pc?

You do. Although technically it will work, you have in your gateway:

192.168.1.2 255.255.255.0

...but on the pc:

192.168.1.7 255.255.255.128:

> ----PC Settings----
> IP: 192.168.1.7
> Mask: 255.255.255.128 (same in rc.conf)
> Gateway: 192.168.1.2
> Dns: x.x.88.17
> Dns: 192.168.1.2

I'm not convinced that there still isn't a cabling issue,. I don't use
NAT, so perhaps someone else can help with any config issues, but I
would find out/fix what is causing the traffic to be received on the
wrong interface first.

Also, I just noticed in your original post that there appears to be
another clerical error. Again, I don't know ipnat, but I would suspect
that this:

map fxp0 192.168.0.0/16 -> 0/32

should really be this:

map fxp0 192.168.0.0/24 -> 0/32

Aside from that, are you sure that this entry shouldn't be:

map rl0 192.168.0.0/24 -> 0/32

? Again, I don't know ipnat, but to me, in the fxp0 entry, it looks like
you are trying to map the 192 space coming INTO fxp0 (which in your
original post is the NIC that faces the ISP, not the internal network).
If this is how ipnat looks at this, then this is also a problem.

Steve

--------------ms080901060202040402090300
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIII/zCC
AtowggJDoAMCAQICEEs5xg/J3t77QWJ4SatV1HcwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UE
BhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMT
I1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA5MD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hkiG9w0BCQQxFgQUidQTsJwhtjrnQENQD/X4NqiS
W6MwUgYJKoZIhvcNAQkPMUUwQzAKBggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZI
hvcNAwICAUAwBwYFKw4DAgcwDQYIKoZIhvcNAwICASgwgYUGCSsGAQQBgjcQBDF4MHYwYjEL
MAkGA1UEBhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAq
BgNVBAMTI1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBAhBLOcYPyd7e+0Fi
eEmrVdR3MIGHBgsqhkiG9w0BCRACCzF4oHYwYjELMAkGA1UEBhMCWkExJTAjBgNVBAoTHFRo
YXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJzb25hbCBG
cmVlbWFpbCBJc3N1aW5nIENBAhBLOcYPyd7e+0FieEmrVdR3MA0GCSqGSIb3DQEBAQUABIIB
AFN7AL2rRw16Fi+N4EMI1dsEz5EhgQ46EUXbDQQdOAyRSb1leRz/tyOFmF8lP6HyqJJBRn2Z
X5PbfFQV2eRUFUbosK0brtY+ilUwIM6K7Yjb1OPqnj6wDEWXfxJKteZFOrU+8F4CRT0EPQ7L
XwKv4cV0WYvQkZSu1djS7NAtiMyy6X9nbL7Yr1W79EZshWEwgs5pKW6ns84HNDNZ0ajCbalH
YM2/WFqo3CD8jO/BM2WBrk8K3swbaaycLUR/+tQU/VK2F4g1H0UG8BkYISE+qZmhExhcVzZ0
Dd6QgV3UeoiJzXEEvuLVNgpSAHCfhINWi7XpvwYigRBVgKoVvi4hxSUAAAAAAAA=
--------------ms080901060202040402090300--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AB39479.8090205>