Click to See Complete Forum and Search --> : is the hostname important for internet sharing?
Ludootje
02-04-2002, 01:13 PM
The server: linux-mandrake8.0, hostname 'NETWERK'
mine: libranet, hostname 'localhost'
a win2k: hostname 'localhost'
a win98: hostname 'localhost'
Only the server has internet, we don't know why. is it possible that the hostname matters?
If not, anyone ideas (I mostly want ideas for letting the libranet work of course since it's mine ;))?
Alex Cavnar, aka alc6379
02-04-2002, 01:57 PM
I dunno... I don' t think it's important. In order to have connection sharing, check that you have your client boxes set to use the server as their DNS server. Also make sure that the client boxen are set up to use the server as their gateway. It should work then-- That's what I used to get my box online.
Ludootje
02-04-2002, 03:27 PM
erm, how do i do that? when the server used win2k, i simply had in my /etc/init.d/network:
pump -h localhost eth0
which i still have, but now it seems to not work... :(
where can i tell it to use the server for dns and as gateway?i did a kernel recompile, and told it that i have realtek ethernet cards etc, and the internet worked when the server was in mandrake (i don't if it still worked after the recompile, but i don't think so, i did some changes to the server AFTER the kernel recompile, so it could be that too... anyway the old kernel doesn't work anymore :/) the other wins on the network don't have internet neither, i think it's a problem with the mandrake8.0, the server...
anyway: how can i tell it to use the server as dns?
also, a kernel recompile doesn't change internet config files, right?
Thanks.
[ 04 February 2002: Message edited by: Ludootje ]
Joeri Sebrechts
02-04-2002, 03:57 PM
Okay, I told some of this on #grasshoppers, but here is my config:
Internal network is 192.168.0.0/24
External interface (network card going to the cablemodem) is eth1.
I have a firewall script on my server that runs every time my ip changes, but this is the basic forwarding part of it:
# activate ip masquerading
echo "1" > /proc/sys/net/ipv4/ip_forward
# flush forwarding ruleset, and set default policy to deny (so forwarding will only go from inside to outside, not the other way around)
/sbin/ipchains -F forward
/sbin/ipchains -P forward DENY
# forward internal traffic to internet
/sbin/ipchains -A forward -i eth1 -s 192.168.0.0/24 -d 0/0 -j MASQ
On windows client boxes you need to set gateway to the ip of your gateway/server machine (in my case 192.168.0.1), and configure the dns separately (although if you're using dhcp the dns thing might not be necessary)
Linux client systems differ, but a universal approach is:
route add default gw 192.168.0.1
where you replace the ip with your gateway's ip, obviously. (And set the dns entries correctly ofcourse)
This command would need to be re-executed every time you reboot, so it's best you figure out how your specific linux deals with gateways. (I can help with debian clients, but not right now, since my laptop is loaned to my sister, and my desktop is currently broken)
[ 04 February 2002: Message edited by: Joeri Sebrechts ]