Date: Sun, 09 Aug 2009 09:46:48 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Nerius Landys <nlandys@gmail.com> Cc: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: Network bridge, but assigned IP address Message-ID: <4A7E8CF8.1080109@infracaninophile.co.uk> In-Reply-To: <560f92640908082323j7a243fd0r22af5b947442745d@mail.gmail.com> References: <560f92640908082323j7a243fd0r22af5b947442745d@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig2F3C1FE9F79F48AE43BF1263 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Nerius Landys wrote: > I am creating a simple network bridge (as described in > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-bridg= ing.html) > which consists of 5 network interface cards. Function-wise, it's > basically acting as a switch. However, I want to assign an IP address > to the machine with the 5 NICs. >=20 > So far without the bridge everything is working perfectly, and my > /etc/rc.conf looks like this: >=20 > gateway_enable=3D"YES" > hostname=3D"speedy.i" > ifconfig_fxp4=3D"DHCP" > ifconfig_em0=3D"inet 192.168.0.254 netmask 255.255.255.0" You should remove this ifconfig_em0 setting ... =20 > And I have a NAT (using pf) to allow the 192.168.0.x hosts to directly > reach the outside internet. fxp4 is the external network card. My > other network cards that I want to make part of the internal network > (acting as a switch) are fxp0 through fxp3. So I'm not sure what to > do with my rc.conf. In the handbook it says to add these lines: >=20 > cloned_interfaces=3D"bridge0" > ifconfig_bridge0=3D"addm em0 addm fxp0 addm fxp1 addm fxp2 addm fxp3 up= " > ifconfig_fxp0=3D"up" > ifconfig_fxp1=3D"up" > ifconfig_fxp2=3D"up" > ifconfig_fxp3=3D"up" > ifconfig_em0=3D"up" =2E.. and then add all of these lines to the rest of the existing rc.conf= > How should I intermingle these lines with my existing rc.conf, and/or > which lines should I remove? I want em0, fxp0, fxp1, fxp2, and fxp3 > to be a bridge and be assigned the IP address 192.168.0.254. To give the whole ensemble an IP address, simply set the IP on the bridge= 0 interface. I think you can do it most easily by adding this line, ipv4_addrs_bridge0=3D"192.168.0.254/24" but in case that doesn't work correctly, just extend the ifconfig_bridge0= setting: ifconfig_bridge0=3D"addm em0 addm fxp0 addm fxp1 addm fxp2 addm fxp3 inet= 192.168.0.254 netmask 255.255.255.0 up" See the section on network_interfaces in rc.conf(5) for more detail and some other possibilities. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig2F3C1FE9F79F48AE43BF1263 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkp+jP4ACgkQ8Mjk52CukIzn3QCeN3Oh0vEXSQNEM7x8yv1rFyam /JcAn3QTfV1Ynoxk18hNmilYeixgFkm6 =Ppv6 -----END PGP SIGNATURE----- --------------enig2F3C1FE9F79F48AE43BF1263--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A7E8CF8.1080109>