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

Re: Modem Gateway



On Wed, 2002-07-24 at 10:11, dan.hunt@st.brieux.com wrote:
> On 23 Jul 2002 at 16:56, Crispin Wellington wrote:
> > > --snip
> > Change the IP number to 192.168.0.2
> Done. That helped! 
> > Once you have those modules installed, And each internal machine can
> > ping the other, and the gateway machine can contact the net, then run
> > that iptables command from the previous post to set up masquerading.
> > 
> > Then your internal machine should be able to see the Internet.
> No.
> Now I can ping each machine from the other. 
> I can ping the internet from the "modem gateway" machine.
> I cannot ping the internet from the other end of my crossover cable or the 
> "internal machine". 

Make sure that iptables nat command is run. 

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

Also make sure ip forwarding is switched on.

echo "1" > /proc/sys/net/ipv4/ip_forward

THen try to contact the net from the internal machine

> During the troubleshooting phase of this home network project, I found that 
> diald was annoying me. Often it would connect whenever I would run mc or 
> Midnight Commander. So it is gone now. Just pon and poff. I know the dial-up 
> is on. However when I ran "apt-get remove diald"
> I did get a message about iptables. I didn't write it down or remember it.
> 
> I am starting and stopping these two machines from time to time to change 
> the kernel, and booting to M$ to get my mail. I think I ( we ) must automate 
> the network ifconfig and route commands. So please let me know if I have this 
> correct. ( From Memory and some notes )
> 
> Modem Gateway Machine
> ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up
> route add 192.168.0.2 eth0
> I have a old webpage that suggested this,
> route add -net 192.168.0.2 netmask 255.255.255.0 eth0
> but it gave me a error. Perhaps I will it try again.

You can do all of this automatically at startup by editing the
/etc/network/interfaces file. Make sure there is an entry like

iface eth0 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255

in your gateway. And an entry like

iface eth0 inet static
        address 192.168.0.2
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
	gateway 192.168.0.1

in the same file on your internal machine. This will set up the
interface IP numbers and the routes for those networks.

> What information would help troubleshoot this ?

A good way to trouble shoot is to run a sniffer. For eg, apt-get install
iptraf on the gateway. Run this on the gateway and sniff the various
interfaces as you ping, traceroute, whatever from the internal machine.

> How would I set up the ip and port number to access the internet from the 
> internal machine once I can ping the ip address of my virtual host's dns 
> server? 

That iptables command will (should) set up masquerading of traffic going
out your ppp link.

Kind Regards
Crispin Wellington



-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: