All times are UTC-06:00




Post new topic  Reply to topic  [ 20 posts ] 
Author Message
PostPosted: Tue Feb 14, 2006 12:33 am 
Offline

Joined: Sat Feb 11, 2006 7:05 am
Posts: 14
Location: Stockholm, Sweden
Or am i just confused ?

There are so many network configuration parts, and im not really familiar with how MOL handles networking.
I think it works like the Linux part fowards all packets from OSX to the network.

1. theres settings in OSX
2. theres the start-misc settings
3. theres resolv.conf for DNS
4. theres DHCP settings

My theory is that you set the start-misc IP, and the network adress ( and also a default gateway on the local network ? ), then you set the OSX IP to be on the same network as the start-misc one, and default gateway IN OSX to the start-misc IP adress. ( dns here should also be start-misc IP ? )
In resolv.conf you set actual DNS on the internet.

And finally i skip the dhcp settings altogether. =P

This however doesnt work, maybe someone can tell me why, or tell me how to config it to work.


Last edited by corpsicle on Thu Feb 16, 2006 1:30 am, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Tue Feb 14, 2006 6:40 am 
Offline

Joined: Tue Feb 14, 2006 6:13 am
Posts: 4
Location: Prague
As OS X runs under Linux, the Linux serves as a router (NAT) for OS X. The connection between Linux and OS X should be automatically configured by Linux's DHCP daemon. Just set the OS X TCP/IP configuration as automatic, it will get the IP, Gateway and DNS assigned via DHCP (don't forget to install the MOL drivers under OS X).
You should manually configure only the Linux part of networking. As you wrote: resolve.conf for DNS, start-misc for IP and gateway.

And here is my question for Frostwork: can be the Linux ethernet configuration in MOLK set up automatically by DHCP? Is the MOLK kernel and networking compiled with DHCP client support?


Top
   
 Post subject:
PostPosted: Tue Feb 14, 2006 6:51 am 
Offline

Joined: Sat Feb 11, 2006 7:05 am
Posts: 14
Location: Stockholm, Sweden
Ok, then i got it kinda right.
But the dhcp adresses are 192.168.41 or something like that.
How does it reach the default gateway which is the linux ip ?
The linux ip is on a different network altogether isnt it ?
And start-misc has 2 networking lines, the first is the IP, and the second is the router ?
I thought the second was just the network adress ...


Top
   
 Post subject:
PostPosted: Tue Feb 14, 2006 7:29 am 
Offline

Joined: Sat Feb 11, 2006 7:05 am
Posts: 14
Location: Stockholm, Sweden
Ok, then i got it kinda right.
But the dhcp adresses are 192.168.41 or something like that.
How does it reach the default gateway which is the linux ip ?
The linux ip is on a different network altogether isnt it ?
And start-misc has 2 networking lines, the first is the IP, and the second is the router ?
I thought the second was just the network adress ...


Top
   
 Post subject:
PostPosted: Tue Feb 14, 2006 7:59 am 
Offline

Joined: Tue Feb 14, 2006 6:13 am
Posts: 4
Location: Prague
You should have a look at the Networking document in molk Doc folder:
Code:
1. TUN driver
=============

The TUN driver provides networking through the use of an IP tunnel. It is configured
by the line

netdev: tun0 -tun

The network topology will look similar to the following example:

-Ethernet----------------------------------------
| |
130.237.226.234 | 130.237.226.239
eth0 | other_machine
linux
tun0 |
192.168.41.1 |
| virtual
+--- ip-tunnel ------- mol
192.168.41.2

That is, the linux box typically has two configured network interfaces: eth0 and tun0.
The virtual tun network should use local IP addresses (these IP numbers have no meaning
to external hosts).

Unfortunately, mol can not connect to external hosts in the above setup (precisely
because external hosts do not know that the 192.168.1.2 address sits behind the
130.237.226.234 box).

The solution to this problem is NAT (network address translation, also called
IP-masquerading). In this case we want to make it appear as if packets sent from
MOL to an external host really originate from the linux box (an external host know
how to reach 130.237.226.234 and linux forwards packets to MOL whenever appropriate).

MOL normally configures NAT automatically from the /etc/mol/tunconfig script.
For reference, it basically does the following:

/sbin/iptables -t nat -s 192.168.41.0/24 -d ! 192.168.41.1
-A POSTROUTING -j MASQUERADE

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

The client side of the network is usually configured automatically by the built-in
DHCP server. It should look something like the following:

IP: 192.168.41.2
Netmask: 255.255.255.0
Gateway: 192.168.41.1
Nameserver: 192.168.41.1 (or whatever)

By defaul, MOL adds an alias NAT rule which redirects nameserver queries to
the linux host (192.168.41.1) to the first entry in /etc/resolv.conf.
I'm not sure about the second networking line in the start-misc script, but I guess that it should look like this :
route add default gw X.X.X.X dev eth0
where X.X.X.X should be replaced by your gateway/router IP.

I'm only helping my friend to get molk/Tiger networking running on his Pegasos II and he has not tried molk 0.6 yet, so please try it and report back your success or failure, thanks.


Top
   
 Post subject:
PostPosted: Tue Feb 14, 2006 8:04 am 
Offline

Joined: Sat Feb 11, 2006 7:05 am
Posts: 14
Location: Stockholm, Sweden
Heh, i was looking at that document last night.
And i did add a route add default gw line to no avail ... but i entered OSX config manually, i should try DHCP.
Ill report. =)


Top
   
 Post subject:
PostPosted: Wed Feb 15, 2006 12:55 am 
Offline

Joined: Sat Feb 11, 2006 7:05 am
Posts: 14
Location: Stockholm, Sweden
ITS WORKING!

start-misc =

1st row, IP of the computer, fitting to local network
2nd row, IP of local network ( ie 192.168.0.0 )
( basicly these two rows are good in default setting unless you have a different network IP setup at home )
3rd row, default gateway ( ROUTE ADD DEFAULT GW *ip of default gateway* )

Then just set up OSX with DHCP, BUT i had to enter the DNS manually, it wouldnt catch the one i set in resolv.conf for some reason.


Top
   
 Post subject:
PostPosted: Wed Feb 15, 2006 6:40 am 
Offline

Joined: Fri Sep 24, 2004 1:39 am
Posts: 297
Hi!

Good to hear you got it working! :)
Unfortunately I don't have internet to test with, that's why i didn't know
of the gateway stuff... ???
The resolv.conf is probably not even used (probably should have removed it...)
Any comments, suggestions for updates are always welcome...

frostwork


Top
   
 Post subject:
PostPosted: Wed Feb 15, 2006 6:49 am 
Offline

Joined: Sat Feb 11, 2006 7:05 am
Posts: 14
Location: Stockholm, Sweden
Thank YOU frostwork for making MOLK.
Now i just hope MOL can get 3d hardware acceleration at some point. =)
Is there a way to change the topic name ? =P


Top
   
 Post subject:
PostPosted: Wed Feb 15, 2006 9:03 am 
Offline

Joined: Tue Feb 14, 2006 6:13 am
Posts: 4
Location: Prague
Hi frostwork, thank you for your great work.

The resolv.conf is used in tunconfig:
Code:
#########################################################
# Configure interface
#########################################################

[ "$ACTION" = up ] && {
/sbin/ifconfig $TUN_DEV $TUN_HOST

# masquerade the tun network
$IPTABLES -t nat -A POSTROUTING -s $TUN_NET -d ! $TUN_NET -j MASQUERADE

# DNS redirection
[ "$DNS_REDIRECT" = yes ] && {
[ ! "$NAMESERVER" ] && {
NAMESERVER=`grep ^nameserver /etc/resolv.conf | awk -- '{ print $2 ; exit 0; }'`
[ ! "$NAMESERVER" ] && {
echo "Could not determine the nameserver (localhost is used)."
NAMESERVER=$TUN_HOST
}
}
echo "DHCP nameserver exported: $NAMESERVER"

$IPTABLES -t nat -N mol-ns-redirect 2> /dev/null
$IPTABLES -t nat -A mol-ns-redirect -j DNAT --to $NAMESERVER

# redirect tcp/udp port 53 (nameserver queries)
$IPTABLES -t nat -A PREROUTING -p tcp -i $TUN_DEV -d $TUN_HOST --dport 53 -j mol-ns-redirect
$IPTABLES -t nat -A PREROUTING -p udp -i $TUN_DEV -d $TUN_HOST --dport 53 -j mol-ns-redirect
}
}
But I'm affraid that the path /etc/resolv.conf may not be correct, I don't know where is the mol directory mounted in molk when TUN is being configured... (unortunately, I don't have pegasos machine, I'm trying to help my friend to get his new pegasos II box up and running and I don't have access to it right now)

I have one more question for you (I wrote it in my first reply in this thread): can be the Linux ethernet configuration in MOLK set up automatically by DHCP? Is the MOLK kernel and networking compiled with DHCP client support?


Top
   
 Post subject:
PostPosted: Wed Feb 15, 2006 9:28 am 
Offline

Joined: Wed Feb 01, 2006 12:21 pm
Posts: 32
MOL itself is fairly easy to configure so that the network is set up by default with dhcp. In fact, it should work out of the box on Gentoo in just this fashion. :) Take a look at the Gentoo ebuild, it has all of the required kernel options listed to have this work correctly out of the box.


Top
   
 Post subject:
PostPosted: Wed Feb 15, 2006 9:42 am 
Offline

Joined: Tue Feb 14, 2006 6:13 am
Posts: 4
Location: Prague
Thanks for the info JoseJX, but MOL on Gentoo is one thing, and MOL on molk is another...


Top
   
 Post subject:
PostPosted: Wed Feb 15, 2006 4:23 pm 
Offline

Joined: Wed Feb 01, 2006 12:21 pm
Posts: 32
I was directing that more to frostwork, so he can take a look for the next version of MOLK. Sorry. :p I'm also the current maintainer of MOL, so if there are any patches that you need included, please let me know.


Top
   
 Post subject:
PostPosted: Wed Feb 15, 2006 7:37 pm 
Offline

Joined: Wed Oct 20, 2004 11:20 pm
Posts: 82
JoseJX,

Welcome to our humble group!

--Aaron Diezman
(AaronPPC on Gentoo forums)


Top
   
 Post subject:
PostPosted: Wed Feb 15, 2006 10:39 pm 
Offline

Joined: Sat Feb 11, 2006 7:05 am
Posts: 14
Location: Stockholm, Sweden
JoseJX : 3d hardware acceleration!! =D

I really think MOL is a fantastic thing, thanks for making it possible.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 20 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
PowerDeveloper.org: Copyright © 2004-2012, Genesi USA, Inc. The Power Architecture and Power.org wordmarks and the Power and Power.org logos and related marks are trademarks and service marks licensed by Power.org.
All other names and trademarks used are property of their respective owners. Privacy Policy
Powered by phpBB® Forum Software © phpBB Group