I need help to set up internet sharing in linux.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers I need help to set up internet sharing in linux.
# 1  
Old 06-10-2002
Question I need help to set up internet sharing in linux.

Ok, I'm kind of in between newbie and experienced somewhere. I'm an advanced computer user but only have a little experience with linux and a lot of problems with it. Currently I'm using Linux-Mandrake 8.0 (I know, I know, but let's not go into the many reasons why it's not even close to the best distro.) I tried using the little ICS setup wizard or whatever you would call it and it didn't work. The client would get an IP that was correctly assigned, but it couldn't get DNS resolutions or connect to any addresses.

Basically what I want to do is get help aimed more at a newbie on how to properly set up the normal way of ICS in linux using IP tables and whatever. I don't need the linux box to act as a firewall really because, for reasons that are too complicated to explain all out right now, the linux box is actually going through another proxy, so I have two network cards set up in it. I set up the one going to the LAN and the proxy to use 192.168.0.2 and the one that this computer would be connecting to is 192.168.1.1 so that the os would know which one to use for what.

I know this all sounds a little crazy, but, please, bear with me.

Basically, I have a computer sharing the internet connection on the LAN using the IP address 192.168.0.1 and there are two other computers on that LAN which connect through it. I would like to set up this linux box on 192.168.0.2 or any other IP address in that general range and connect my computer through it via that two network card method. This way I have a linux server on the lan among other things. (Don't worry, there's more than one reason I'm trying to do this, just too many.)

Also, I would really like to be able to set it up as a DNS server as well and to be able to manually refresh the DNS tables. I have problems every now and then with DNS and using the hosts file on my windows computer just isn't working for a few sites. Besides, presumably internet based things will go a little faster when they don't have to wait for a reply from my ISP to get the IP address.
# 2  
Old 06-14-2002
In anutshell you want to do:

# In the NAT table (-t nat), Append a rule (-A) after routing
# (POSTROUTING) for all packets going out eth0 (-o eth0) which says to
# MASQUERADE the connection (-j MASQUERADE).
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

# Turn on IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward


Lets call the box running iptables "router". You would set the default gateway on your other machines to point at router. Their DNS could point to an external box, or your internal machine.
(Above examples assumes eth0 is your internet interface).
See http://netfilter.samba.org for lots of docs on how to use iptables.

Setup BIND (ugh...lots of security problems) or djbdns (http://cr.yp.to) on your internal box to do DNS (most likely a caching server which points at the external world).
# 3  
Old 06-16-2002
Quote:
Originally posted by PxT
In anutshell you want to do:

# In the NAT table (-t nat), Append a rule (-A) after routing
# (POSTROUTING) for all packets going out eth0 (-o eth0) which says to
# MASQUERADE the connection (-j MASQUERADE).
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

# Turn on IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward


Lets call the box running iptables "router". You would set the default gateway on your other machines to point at router. Their DNS could point to an external box, or your internal machine.
(Above examples assumes eth0 is your internet interface).
See http://netfilter.samba.org for lots of docs on how to use iptables.

Setup BIND (ugh...lots of security problems) or djbdns (http://cr.yp.to) on your internal box to do DNS (most likely a caching server which points at the external world).
Thanks. I'll look into that as soon as I get the chance. As for security issues, well, I'm not really too concerned. The pc isn't exactly vital for anything and, besides, it's behind that first PC anyway, but even if someone did attack it it wouldn't do much damage. Even if I have to reinstall, once I get ICS working once, I should be able to remember well enough how to do it again.

Last edited by Nazo; 06-16-2002 at 12:59 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Sharing internet from Ubuntu to Solaris server

Hey guys can anyone explain to me how to share my laptops (on ubuntu with wifi) to my sunfire v100 thats connected via ethernet? Whats the process for that? I'd appreciate it! Thanks (1 Reply)
Discussion started by: austinramsay
1 Replies

2. IP Networking

Sharing internet connection

Hello all, Recently took a dive into Unix using Fedora 12 atm. I have cable modem with DHCP and a linksys 8 port router. With windows I was able to simple use the uplink port and plug each computer into the switch and use the internet connection. Having no luck doing the same in Unix. I have... (0 Replies)
Discussion started by: Fingerz
0 Replies

3. Emergency UNIX and Linux Support

Sharing internet from host os to guest os

I have a host os Windows 7 ultimate in place where virtual box is installed. Now in virtual box I have installed solaris 10. There is internet connection present in host windows 7 still I am not able to access internet in solaris 10. Please help to configure solaris so that internet can be... (12 Replies)
Discussion started by: hiten.r.chauhan
12 Replies

4. UNIX for Dummies Questions & Answers

Sharing a Unix Drive Over The Internet ... but

I don't know if this can be done, otherwise, my project will come to a screeching halt. I have a SCO 5.0.5 machine connected to the internet with a static IP address. I need to be able to share a drive : /shareddrive I need to map to it from a windows machine: hence, what i'd like to... (3 Replies)
Discussion started by: gseyforth
3 Replies

5. Linux

How Do I Set Internet With Linux

I am a new learner of linux, my friend told me that it is very good to learn linux, so I dropped the idea of deleting it but now I faced a problem again , how am I going to set my computer to connect to my ISP and other computers?? (1 Reply)
Discussion started by: terrychen0804
1 Replies

6. IP Networking

Routing, Port Mapping, Internet Sharing etc etc

I'm running OS X. (OS X Server actually) and right now I use a program called BrickHouse to handle my router configuration. But this program kind of sucks. I'd much rather learn how to configure these programs manually. By these programs, I mean the programs OS X comes with to handle these jobs... (0 Replies)
Discussion started by: l008com
0 Replies

7. IP Networking

win2k to Mandrake,Internet Connection Sharing!

i've got a win2k machine(192.168.0.2) that i want to give access to mandrake through my network (192.168.0.0 255.255.255.0). I enabled ICS and setup the mandrake machine to be (192.168.0.3 255.255.255.0) and i'm still not able to get Internet Access to my Mandrake. I guess I have to do Dynamic... (2 Replies)
Discussion started by: jlb00h
2 Replies

8. UNIX for Dummies Questions & Answers

Internet sharing

I wanted to share internet with my Server running Win 2000 and client on Solaris 8. I networked them with a hub and 2 NICs on Server. Is there any software to share the internet? Need help!!!!!!!!!! Thanks... Praveen (5 Replies)
Discussion started by: praveenk
5 Replies

9. IP Networking

Internet Sharing with SUSE 7.3

I have a home network connected to a cable modem. I would like to use my SUSE 7.3 as a proxy. My layout is this. all computers connected to a hub. SUSE has 2 nics. 1 for cable modem(eth0, one for internal network connected to hub(eth1) All other machines connect to hub eth0 - DHCP from ISP... (1 Reply)
Discussion started by: gdboling
1 Replies

10. UNIX for Dummies Questions & Answers

Internet Sharing

I'm new to the unix world, but have been asked if our company could set up a high speed internet connection to our unix server in order to connect all our users without haveing to pay for all these telephone lines. I assume it is easy but unsafe. Any help from the basics to the advanced will be... (2 Replies)
Discussion started by: Mike11
2 Replies
Login or Register to Ask a Question