Re: 2 different routes

alex_at_ise-spb.org
Date: 10/28/04


Date: 28 Oct 2004 01:12:38 -0700

I solve this problem!!!

rc.conf

defaultrouter="213.х.х.225"
ifconfig_rl0="inet 213.х.х.226 netmask 255.255.255.240"
ifconfig_rl2="inet 193.y.y.178 netmask 255.255.255.240"

gateway_enable="YES"
router_enable="YES"

ipfw:

ipfw add fwd 193.x.x.177 ip from 193.x.x.176/28 to not 193.x.x.176/28

and it works!

freebsd is accessable by 213.х.х.226 and by 193.y.y.178

but there is a probleb - i couldn't filter traffic for subnet 193.x.x.176/28 :(

rules
ipfw add allow all from 193.x.x.176/28 to any
ipfw add allow all from any to 193.x.x.176/28 established

doesn't work after fwd rule
and if i put them before fwd rule - fwd rule doesnt' work :((

whats wrong?

jpd <read_the_sig@do.not.spam.it> wrote in message news:<1098821200.649264@entelocal.ipberlin.com>...
> On 2004-10-26, Martin <nospam@example.org> wrote:
> > alex@ise-spb.org wrote:
> >> I have 2 REAL subnets:
> >> 213.x.x.224/28 (gw = 213.x.x.225)
> >> 193.y.y.176/28 (gw = 193.y.y.177)
> >>
> >> rl0 has adress 213.x.x.226
> >> rl1 has adress 193.y.y.178
> >>
> [snip]
> >> is it possible to make it accessable by 2 ip at the time?
> >
> > You want something like:
> >
> > route add -net 193.y.y.176/28 193.y.y.177
> >
> > though I've probably got the syntax wrong. Get that working by hand, then
> > look into making it work automatically at boot-up via /etc/rc.conf .
>
> What's more important; you're trying to route a subnet you're in through
> its gateway -- that won't work the way you expect it to. The route
> for the subnet is fine, it'll be added automatically as soon as you
> do ifconfig rl1 193.y.y.178/28. (ifconfig adds that route, see the
> manpage.)
>
> What you'd need for the above setup to work for the rest of the world
> is FreeBSD keeping state and doing source-based routing. By itself its
> route table doesn't support that, AFAIK. One could try and use NAT
> or build a firewall ruleset that will toss off return packets to the
> gateway of the secondary public network for things that came in on that
> interface.
>
> Maybe someone better versed in ipf/ipfw/pf and/or natd can tell if this
> can be done. I think that at least with NAT you can do _something_, even
> if you have to hide things for your applications (and that will be a
> drawback for eg http servers). I think that otherwise OP is looking at
> hacking the routing mechanism in FreeBSD itself.
>
> This is different from two gateways on one subnet (which solaris seems
> to support in a round-robin way) in the obvious way. Note that the
> windows routing stuff does support multiple gateways on multiple subnets
> but it will toss packets to either of them indisciminately. (Very useful
> in making the users think that the network is INCREDIBLY S L O W, that
> with an effective packet loss of 50% or more, if one of the networks
> happens to be private not routed.)



Relevant Pages

  • Re: MultiHomed Workstation - Which NIC is being used?
    ... from the 10.0.1.* subnet to a web server on my ... back to the Internet via NIC1, or will it know that it has to exit via NIC2? ... > Network Connections folder, choose Advanced from the menu, choose Advanced ... Thus, for the first three conditions, no default gateways are used ...
    (microsoft.public.win2000.networking)
  • Re: ICS questions and confusion
    ... >>>It doesn't HAVE to be on a different subnet, ... but that requires that the ICS host become a bridge. ... >> ICS is a software based NAT router, and routers work best when the ... >> network already had the required address 192.168.0.1" is confusing. ...
    (microsoft.public.windowsxp.network_web)
  • Re: How to set my MAC address
    ... because the VLAN isolation fails between the wifi side and the wired ... ports that I started experimenting with the 2nd subnet feature. ... there is no option to isolate the wireless from the VLAN. ... give out the password of my own wifi network, ...
    (uk.comp.sys.mac)
  • Re: CIDR Explanation
    ... slash notation that's becoming more common. ... CIDR or Classless Internet Domain Routing is VERY similar to subnetting and is ... This two part address is built of a network address and a host address. ... TCP/IP Classes allow for a 'default' subnet mask to identify the network from ...
    (Security-Basics)
  • Re: Make a DHCP server using Fedora - Help
    ... The dhcpd configuration is highly network-dependent. ... What is your network topology? ... please write a subnet declaration ... Do you want dynamic updating of your local dns server? ...
    (Fedora)