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

RE: DHCP and PPP



On Wed, 06 Apr 2005 at 12:43 PM David Hoffman said:
>> 
>> On Apr 6, 2005 11:34 AM, Henry Hartley wrote:
>> > As of this week, I'm on a cheaper circuit without any spare IP
>> > addresses.  The former users all were getting broadband so it
>> > wasn't suppose to matter but my parents order for broadband is
>> > taking longer than expected.  I'd like to give them their ppp
>> > back until Verizon gets things set up but don't know how to set
>> > it up so that dhcp can assign a private IP address to the modem.
>> > Can anyone here point me to documentation that will help me with
>> > this?
>> > 
>> > I've configured a simple DHCP server before but it didn't involve
>> > ppp and I don't really know where to start.  Any help you can
>> > provide would be greatly appreciated.
>> 
>> It sounds like what you need to do is create your new IP Addresses
>> on a private (192.168.x.x) network, and then set your system to use
>> NAT to allow the traffic to pass. That way you don't have to depend
>> on other existing IP Addresses, and your machine can route the
>> traffic through using NAT. I know there is information at TLDP.org
>> with how-to's on setting up Masquerading (NAT) and PPP, but I don't
>> recall actual links right now.

This turns out to have been much easier than I expected.  First, put
the private IP address in /etc/hosts 

	192.168.0.2 ppp1

Then, make sure /etc/ppp/options.ttyS0 has this in it (with the real
domain name):

	mydomain.com:ppp1

Finally, be sure iptables will not get in the way with this section:

	# nat the private network addresses used for dhcp
	*nat
	:PREROUTING ACCEPT [566:30646]
	:POSTROUTING ACCEPT [799:50552]
	:OUTPUT ACCEPT [799:50552]
	-A POSTROUTING -s 192.168.0.0/255.255.255.0 -j MASQUERADE 
	COMMIT

and of course reload the running iptables with:

	iptables-restore /etc/sysconfig/iptables

And it works.  I don't need DHCP at all, it seems.  Okay, I admit, I
didn't figure this out on my own.  Thanks to Amy Alford for her
brilliant and timely help.

-- 
Henry


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