Re: dhcpd gateway settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, April 22, 2011 01:58:35 PM Aaron Gray wrote:
> On 22 April 2011 19:37, Rick Sewill <rsewill@xxxxxxxxx> wrote:
> > On Friday, April 22, 2011 12:11:38 PM Aaron Gray wrote:
> > > I am trying to set up a network and gateway on 192.168.1.x that I am
> > 
> > using
> > 
> > > for BOOTP'ing servers.
> > > 
> > > dhcpd.conf
> > > ~~~~~~~~~~~
> > > allow booting;
> > > allow bootp;
> > > ddns-update-style interim;
> > > ignore client-updates;
> > > subnet 192.168.1.0 netmask 255.255.255.0 {
> > > 
> > >     option subnet-mask 255.255.255.0;
> > >     option broadcast-address 192.168.1.255;
> > >     option routers 192.168.1.1;
> > >     option router-discovery true;
> > >     option domain-name-servers 8.8.8.8;
> > >     range dynamic-bootp 192.168.1.200 192.168.1.240;
> > >     next-server 192.168.0.140;
> > >     filename "pxelinux.0";
> > > 
> > > }
> > > subnet 192.168.0.0 netmask 255.255.255.0 {
> > > }
> > > ~~~~~~~~~~
> > > 
> > > But I cannot seem to get HTTP or other services to work on 192.168.1.x
> > > 
> > > I have the existing 192.168.0.x network and was wondering how gateway
> > > requests should get from 192.168.1.x to 192.168.0.1 ?
> > > 
> > > Many thanks in advance,
> > > 
> > > Aaron
> > 
> > If I were a dhcp client, with no other routing configuration information,
> > I will arp for the router at 192.168.1.1 to find the router's mac
> > address. I would send the packet not destined to my local subnet to the
> > router.
> > 
> > I will not arp for 192.168.0.140 because it is not on my local subnet.
> > 
> > The question becomes, how is the router at 192.168.1.1 configured?
> > The router needs to forward the packets to the 192.168.0.x network.
> 
> How do I do that ?

I was reading your answers to Jame's questions on the other sub-thread.
His questions were actually better than my questions.

What is device 192.168.1.1?  Is that the Netgear or your laptop?
>From the other thread I gather 192.168.0.140 is your laptop.
What is the IP address for the Netgear, 192.168.0.1?

A strange question, do you wish your laptop, running Linux, to "filter" packets 
from the 192.168.1/24 network to the Internet?

If the answer to the above question is no, you might consider configuring the 
Netgear to be the gateway for both the 192.168.0/24 and 192.168.1/24 subnets.
http://documentation.netgear.com/fvs336g/enu/202-10257-01/FVS336G_RM-05-08.html
The Netgear will be the gateway for both subnets. 
The Netgear will route traffic between the two subnets.

If, on the other hand, you want your laptop to filter packets from the 
192.168.1/24 subnet to the Internet, you have two choices.

You can configure your laptop to route packets between the 192.168.0/24 and 
192.168.1/24 subnets -or- you can configure your laptop to masquerade packets 
from the 192.168.1/24 subnet when it forwards packets from the 192.168.1/24 
subnet to the 192.168.0/24 subnet (and, by extension, to the Internet).

For both choices where you want your laptop filtering packets from the 
192.168.1/24 subnet, you need to do the following:
1) your laptop needs to do multihoming on the ethernet port
    One IP address, for your laptop, should be 192.168.0.140.
    The other IP address, for your laptop, should be 192.168.1.1.
    I get these two IP addresses based on your dhcpd.conf file.
    If you need help with this, we can go into more detail in another email.
    I know how to do this if you are NOT using NetworkManager.
    Someone else may know how to do this if you are using NetworkManager.

2) Your laptop needs to be set to enable IP forwarding.
     You can dynamically turn on IP forwarding with the following command
     (as root), echo 1 > /proc/sys/net/ipv4/ip_forward
     The above command would need to be done each time your laptop boots.
     Alternatively, you can change the line, "net.ipv4.ip_forward = 0"
     in the file, /etc/sysctl.conf, change the value from 0 to 1, to have the 
    laptop always want to do IP forwarding when it boots.

3) You will need to examine your iptables and change your iptables 
    configuration, as needed, to permit packets flowing between
    the 192.168.0/24 and 192.168.1/24 subnet.

This is where you decide if you want to masquerade packets from the 
192.168.1/24 subnet or simply route packets from the 192.168.1/24 subnet.

If you want to simply route 192.168.0/24 packets, your step 4 is as follows:
4) configure the Netgear to route any packets to the 192.168.1/24 subnet
     through your laptop by telling the Netgear the gateway for the
     192.168.1/24 subnet is 192.168.0.140.  If you wish to do this,
     we need to search the internet to learn how to configure static routes
     on the Netgear.

Alternatively, if you want to have your laptop do masquerading, step 4 is:
4) configure iptables on your laptop to do iptables masquerading when 
    your laptop is forwarding the 192.168.1/24 subnet. 
    I would suggest google: iptables masquerading linux
    The following is a result for a device with two physical interfaces.
    http://www.revsys.com/writings/quicktips/nat.html
    I assume one can use a single multihomed interface in a similar way.

Which of these three choices did you wish to do?
Summary of choices:
1) Have Netgear be the gateway for both subnets
2) Have your laptop be the gateway for the 192.168.1/24 subnet
    in which case the Netgear needs a static route for the 192.168.1/24 subnet
    with a gateway 192.168.0.140
3) Have your laptop be the gateway for the 192.168.1/24 subnet
    and have your laptop do masquerading

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux