Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 2008 16:27:05 +0800
From:      Fbsd1 <fbsd1@a1poweruser.com>
To:        Pongthep Kulkrisada <ptkrisada@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Problem about ppp -nat
Message-ID:  <492670D9.9090100@a1poweruser.com>
In-Reply-To: <20081121060619.GA1057@gmail.com>
References:  <20081121060619.GA1057@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Pongthep Kulkrisada wrote:
> Hi All,
> 
> I have just subscribed to freebsd-questions and I have a question about ppp -nat.
> 
> I have 2 computers. One is running FreeBSD-7.0R, the other is running WinXP. The host running FBSD7.0R has been connecting to the outside world using user-ppp without any problem for very long. Now I want to share internet access to the other host behind NAT through this FBSD host.
> My FBSD machine has 2 interfaces i.e.
> 	tun0 (connecting to ISP) with dynamic IP (of course)
> 	fxp0 (for internal LAN) with static IP of 192.168.1.10
> My WinXP machine has 1 interface (internal LAN) with static IP of 192.168.1.11
> 
> Previously I have a router acting as a gateway for all machines behind NAT. But now I want FBSD machine to work as a gateway. I have never done this before. I tried some googling with reading ppp(8) and ipfw(8). And I tried masquerading but it didn't work. I have plenty configuration files. But the relevant configurations are listed here.
> 
> /etc/rc.conf
> # enable IP forwarding
> gateway_enable="YES"
> # previously I ran web-server, just disable it or comment it out, not sure why!
> #apache_enable="YES"
> 
> On the host running WinXP, I set its gateway and DNS server to the IP of ppp host i.e. 192.168.1.10.
> 
> I then inserted the following line as the first rule in /etc/ipfw.rules.
> /sbin/ipfw add allow all from any to any via fxp0
> (I know this rule is dangerous, but just for testing.)
> 
> I then issue the ppp command.
> root@fbsd:~# ppp -background -nat myisp
> 
> FBSD host (running ppp) can access anywhere but WinXP host can't. I learned from some site explaining that ppp itself has the capability of IP masquerading. And it does not require natd(8). So I don't mention about natd here.
> Anyone have a clue or who have done the correct configurations, please point me out.
> 
> Thank you in advance.
> Pongthep
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 
> 

You need to run dhcp so you can assign ip address on the LAN so the down 
stream xp box can gain access to the public internet through your 
gateway freebsd box.  There is a detailed step by step instructions in 
the install guide at www.a1poweruser.com







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?492670D9.9090100>