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

Re: Help with Masquerading and Ip tables



On Thu, Jul 26, 2001 at 01:13:02AM +0200, Daniel Mashao wrote:
> Hi 
> Can anybody please help
> 
> I am trying to setup a network and getting frustrated by the day.
> 
> I am dialling in from home (HOME) 192.168.0.4 into my work (WORK)
> 192.168.0.1 using PPP. I have set a kernel at work with all the 
> IP stuff in the kernel. Stuff like NAT and so on.
> 
> Once I am logged on I can telnet from HOME into WORK using 
> 192.168.0.1 or 147.134.132.156 (which is my WORK). I have tried
> all the advices but still my HOME cannot go past WORK. In particular 
> when I run route -n on WORK I get the following

telnet = spawn of satan

use ssh!

> Kernel IP routing table
> Destination   Gateway       Genmask         Flags Metric Ref    Use Iface
> 192.168.0.4   0.0.0.0       255.255.255.255 UH    0      0        0 ppp0
> 147.134.128.0 0.0.0.0       255.255.248.0   U     0      0        0 eth0
> 0.0.0.0       147.134.128.5 0.0.0.0         UG    0      0        0 eth0
> 
> on HOME I get
> % /sbin/route -n
> Kernel IP routing table
> Destination   Gateway       Genmask         Flags Metric Ref    Use Iface
> 192.168.0.1   0.0.0.0       255.255.255.255 UH    0      0        1 ppp0
> 127.0.0.0     0.0.0.0       255.0.0.0       U     0      0        0 lo
> 0.0.0.0       192.168.0.1   0.0.0.0         UG    0      0        6 ppp0
> 
> I have tried on WORK
> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
> as adviced my experts but still nothing changes. I cannot even access
> 147.134.128.0 or 147.134.128.5 which is my WORK gateway.

okay. if you get your /etc/network/interfaces set up properly,
then a simple "ipmasq" will get you up and running (at least
that's all i needed) -- "apt-get install ipmasq" to get it.

mine looks like this:

	# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

	# The loopback interface
	iface lo inet loopback

	# local net
	iface eth0 inet static
		address 192.168.1.1
		netmask 255.255.0.0
		network 192.168.1.0
		broadcast 192.168.1.255

	# interface to the wwweb
	iface eth1 inet static
		address MY.REAL.IP.HERE
		netmask 255.255.255.0
		network MY.REAL.IP.0
		broadcast MY.REAL.IP.255
		gateway MY.ISP.ADDR.HERE

for yours i'd say your gateway would be the static address of
your machine at work.

when ifconfig shows what it should, "ipmasq" and check your
routing tables -- try a traceroute to see what happens.

it's been a while since i messed with ppp/dialup (i'm on a
cablemode/microwave transmitter), tho, so there may be other
pointers i'm missing...

-- 
DEBIAN NEWBIE TIP #7 from Will Trillich <will@serensoft.com>
:
Wondering what COMMANDS you have at your disposal? Try pressing
the TAB key at the command line. For example, "apt<TAB>" will
show you all the commands that start with "apt". (This is called
"completion" if you want to look it up in your shell's manpage.)
(Different implementions have the <TAB> completion set up
differently -- you may need to press <TAB> twice.)

Also see http://newbieDoc.sourceForge.net/ ...



Reply to: