LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-01-2004, 04:05 PM   #1
spony
LQ Newbie
 
Registered: Dec 2003
Distribution: Debian (kernel 2.4.22)
Posts: 11

Rep: Reputation: 0
Unhappy Route/Masquerade problem


For the past week or so I've been trying to route my mac through my linux box.

I have the following setup:

Machine 1 - Debian 2.4.22 with 2 interfaces (eth0 and eth1)
Machine 2 - Mac with 1 interface (let's call it eth2)

The linux machine is connected to my cable modem via eth0 - this works fine
The linux machine is connected with a crosscable to my mac via eth1 - this works fine

I've set up the interfaces, like so:
Code:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
auto eth0
iface eth0 inet dhcp

# Second network card - assign static ip to enable local dhcp server

auto eth1
iface eth1 inet static
address 192.168.1.5
netmask 255.255.255.0
broadcast 192.168.1.255
I've set up a DHCPd server on my linux machine, like so:
Code:
default-lease-time 36000;
max-lease-time 86400;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.5;

subnet 192.168.1.0 netmask 255.255.255.0 {
   range 192.168.1.10 192.168.1.100;
}
When i startup the mac it recieves a correct ip# (192.168.1.11) and router (192.168.1.5), which is the ip# attached to eth1 on the linux machine. - So this works fine also

Finnaly as far as I can tell ip forwarding should be working fine as:
Code:
spony:/etc# cat /proc/sys/net/ipv4/ip_forward
1
Now the stuff that doesn't seem to be working fine:

When I'm on the mac I can ping the linux machine fine and the linux machine can ping the mac fine but I can't access the internet from the mac at all.

I've set up an extensive firewall using a program called firehol, this is my setup:

Code:
# Require release 5 of FireHOL configuration directives
version 5
	
# A space separated list of all the IPs on the internet, I trust
#office="my-office-pc.example.com"
	
# The IP address of this Linux and LAN for the rest of the world
#public_ip="1.2.3.4"
	
	
# My LAN. Everything is allowed here.
interface eth1 lan
policy accept	# The default is 'drop'.
	
	
# Make sure the traffic coming in, comes from valid Internet IPs,
# and that is targeting my public IP
interface eth0 internet src not "$UNROUTABLE_IPS"  #dst "$public_ip"
# Protect me from various kinds of attacks.
protection strong
		
# Public servers.
server smtp accept
server http accept
server ftp  accept
server ssh  accept #src "$office"
		
# Make sure idents do not timeout.
server ident reject with tcp-reset
		
# This is also a workstation.
client all  accept
		
	
# Route the LAN requests to the internet.
router lan2internet inface eth1 outface eth0
		
# Masquerading on outface.
masquerade
		
# Route all requests from inface to outface
# and their replies back.
route all  accept
Now as far as I can tell this should do the job. I'm beginning to think the problem has something to do with masquerading but i'm certain this is built into the kernel.

Any idea's folks? I'm about ready to smash something - thanks

 
Old 01-01-2004, 06:49 PM   #2
spony
LQ Newbie
 
Registered: Dec 2003
Distribution: Debian (kernel 2.4.22)
Posts: 11

Original Poster
Rep: Reputation: 0
Update

Hello again,

From my mac I just tried pinging a bunch of ip addresses and they actualy replied.... so apparently something is working. I also tried viewing webpages by supplying the ip instead of dns-name and some of them actualy showed (the ones that didn't came up with an error that the url couldn't be found, the funny thing though is I type for example the URL: "http://206.16.0.28" and it says: "http://www.apple.com could not be found". Is this strange or what?

Make sence to anyone? What am i missing?
 
Old 01-01-2004, 07:26 PM   #3
JordanH
Member
 
Registered: Oct 2003
Location: Toronto, Canada
Distribution: Ubuntu, FC3, RHEL 3-4 AS Retired: SuSE 9.1 Pro, RedHat 6-9, FC1-2
Posts: 360

Rep: Reputation: 30
It sounds like your DNS addresses aren't being distributed to your Mac. Make sure the Mac is configured with the proper DNS addresses or if you are using DHCP to distribute the addresses, then make sure your dhcpd.conf file has the "option domain-name-servers aaa.aaa.aaa.aaa" line included.

Regards,
J.
 
Old 01-01-2004, 07:41 PM   #4
spony
LQ Newbie
 
Registered: Dec 2003
Distribution: Debian (kernel 2.4.22)
Posts: 11

Original Poster
Rep: Reputation: 0
YES!!!

Thanks for the help J, it finnaly works.

Ironicaly enough I had just come to the same exact conclussion. Great to be back on the mac. Linux is great and all but this is the easy life

Now if i can just get VNC installed on both systems, i can stop unplugging my moniter from one to the other
 
Old 01-05-2004, 04:30 PM   #5
JordanH
Member
 
Registered: Oct 2003
Location: Toronto, Canada
Distribution: Ubuntu, FC3, RHEL 3-4 AS Retired: SuSE 9.1 Pro, RedHat 6-9, FC1-2
Posts: 360

Rep: Reputation: 30
VNC is an easy task in Linux. Untar as root and away ya go!

Once it is untarred the fast path to getting a session going is this...
as the user (not root) type
vncserver :1
The first time only it'll ask a password... fill one in.

Voila! You are golden. VNC server running for your user on port 5901.
Cheers,
J.
 
Old 01-06-2004, 09:59 AM   #6
spony
LQ Newbie
 
Registered: Dec 2003
Distribution: Debian (kernel 2.4.22)
Posts: 11

Original Poster
Rep: Reputation: 0
Remote Display speed

Aye it was quite easy to set up VNC on the linux box (also the mac for that matter) however the framerate was just ridiculous. I don't know if this had to do with running the server on the mac and the client on the linux box. Haven't tried the other way around but i asume it's about the same.

However I already had X-windows installed on the mac, and getting it to remote display the Linux machine only involved a few simple steps. My experiance is X-windows has a magnitude faster framerate then vnc. It worked great even when i started up games or loaded the entire KDE desktop.

Currently i'm trying to get my hands on panther so I can try out apple's XFree86 version. Reason is I'm hopeing they include a window manager which easialy shifts back and from rootless mode (ie for running KDE from my linux box unspoiled). Currently I have Xdarwin and the oroborOSX windowmanager which is great for running X-window applications seemlessly in OSX but not so great with entire desktop's.

This tiny LAN is quite a challenge (don't even get me started on the difficulties of getting NFS to work between a linux machine and an OSX machine). Keep saying tomorrow everything will be perfect
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
Masquerade: route sent us somewhere else. Palula Linux - Newbie 15 08-05-2005 06:22 AM
little problem with Masquerade and samba zeroboys Linux - Networking 0 10-07-2004 05:55 PM
masquerade problem (internet sharing) Pres Linux - Networking 4 04-27-2004 09:24 AM
very weird ip-masquerade problem. saturn_vk Linux - Networking 3 11-10-2003 12:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration