Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
02-05-2005, 09:23 AM
|
#1
|
LQ Newbie
Registered: Jan 2005
Posts: 11
Rep:
|
sharing internet
Hi, have have two machines, both with fedora core 3 on...
the network i want to set up looks as following...
internet --- ethernet based router ---- LINUX BOX1 ----- HUB ---- any other computer
the linux box 1 has two ethernet cards, one to connect to the internet which i can do no probs, and another to the hub.
the computers connected to the hub our fine they can see the linux box 1 fine, but they cant seem to share the internet with them. the ip config is shown below but i havnt a clue how ti make linuxbox1 share please help
linuxbox1 card 1 to router ..
ip 192.168.1.4
sub : 255.255.255.0
gateway 192.168.1.1
dns : 192.168.1.1
linuxbox1 card 2 to hub
ip 192.168.0.1
sub 255.255.255.0
gateway 192.168.1.4
dns 192.168.1.4
a computer to connecect to hub...
ip 192.168.0.32
sub 255.255.255.0
gateway 192.168.0.1
dns 192.168.0.1
top summersize, how do i share an internet connection on linux box 1
|
|
|
02-05-2005, 09:55 AM
|
#2
|
Member
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 296
Rep:
|
I have a similar setup, except my main linux box is the firewall and 'router' for the other pc's on the hub/switch.
http://projectfiles.com/firewall/
Its easy to use and edit.
|
|
|
02-05-2005, 10:03 AM
|
#3
|
LQ Newbie
Registered: Jan 2005
Posts: 11
Original Poster
Rep:
|
this isnt helpful it is just a fire wall???? i dont want one as yet i wanna beable to share my internet connect!
|
|
|
02-05-2005, 10:13 AM
|
#4
|
Member
Registered: Nov 2004
Location: Mid. East / Israel
Distribution: Slackware 10.2, Gentoo
Posts: 157
Rep:
|
Hi.
I was in that world of pain too until someone asked me if i had NAT on the external eth. card.
Do you have NAT enabled on your external eth card?
|
|
|
02-05-2005, 10:15 AM
|
#5
|
LQ Newbie
Registered: Jan 2005
Posts: 11
Original Poster
Rep:
|
ok i can answer you with this question...
whats NAT
hehe so thats a no what is it how do i enable it?
and thank you thank you thank you for respomding to my plee hehe
|
|
|
02-05-2005, 10:16 AM
|
#6
|
Member
Registered: Apr 2002
Location: Poland, Gliwice/Pszczyna
Distribution: Mandrake, Slackware
Posts: 41
Rep:
|
do something like that:
Code:
echo 1> /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 192.168.1.4 -s 192.168.0.32
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
where eth0 is linuxbox to router, eth1 - linuxbox to hub
Last edited by nazir; 02-05-2005 at 10:18 AM.
|
|
|
02-05-2005, 10:21 AM
|
#7
|
LQ Newbie
Registered: Jan 2005
Posts: 11
Original Poster
Rep:
|
ok, il give it a try the first line works fine
but it complins about the command iptables
any clues?
|
|
|
02-05-2005, 10:21 AM
|
#8
|
Senior Member
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380
Rep:
|
You need to have ip-masquerading in place and iptables and then have a command to forward to the boxes behind or use a nat routing script to bring it up with the network. An example is MonMotha's script ;
http://monmotha.mplug.org/firewall/firewall/2.3/
|
|
|
02-05-2005, 10:23 AM
|
#9
|
Member
Registered: Apr 2002
Location: Poland, Gliwice/Pszczyna
Distribution: Mandrake, Slackware
Posts: 41
Rep:
|
install iptables package
|
|
|
02-05-2005, 10:27 AM
|
#10
|
Member
Registered: Nov 2004
Location: Mid. East / Israel
Distribution: Slackware 10.2, Gentoo
Posts: 157
Rep:
|
I guess after nazirs tip you'll be fine, anyways, if you'd like to understand it a little bit more there are some pdf files about nat (masquerading).
if you'd like to basicaly secure your connection either you could use this pdf:
http://www.ibiblio.org/pub/Linux/doc...mple-HOWTO.pdf
i hope it'll help you as it helped me to get started with internet sharing.
|
|
|
02-05-2005, 10:28 AM
|
#11
|
Member
Registered: Nov 2004
Location: Mid. East / Israel
Distribution: Slackware 10.2, Gentoo
Posts: 157
Rep:
|
go through the pdf i gave you, you'll know what to do.
|
|
|
02-05-2005, 10:30 AM
|
#12
|
LQ Newbie
Registered: Jan 2005
Posts: 11
Original Poster
Rep:
|
well my machine apprently says its installed, i use yum it says nothing to do, i can even read the manual.
but no it hates me
|
|
|
02-05-2005, 10:49 AM
|
#13
|
Member
Registered: Apr 2002
Location: Poland, Gliwice/Pszczyna
Distribution: Mandrake, Slackware
Posts: 41
Rep:
|
try to find iptables, it should be somewhere in /usr/local/sbin or /usr/sbin, use it with path, and of course you must be root.. as root try this:
in my os it shows:
Code:
iptables: /sbin/iptables /lib/iptables /usr/share/man/man8/iptables.8.bz2
it is in /sbin
then use it AS ROOT with path
fo example
Code:
echo 1> /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 192.168.1.4 -s 192.168.0.32
/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
|
|
|
02-05-2005, 11:21 AM
|
#14
|
LQ Newbie
Registered: Jan 2005
Posts: 11
Original Poster
Rep:
|
well hte cmmands are working fine now!!1
but unfortantly no hope of sharing the interenet as yet
more suggestions :-(?
|
|
|
02-05-2005, 11:46 AM
|
#15
|
Member
Registered: Apr 2002
Location: Poland, Gliwice/Pszczyna
Distribution: Mandrake, Slackware
Posts: 41
Rep:
|
maybe try to ping something from machine behind the nat
|
|
|
All times are GMT -5. The time now is 04:49 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|