LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 02-05-2005, 09:23 AM   #1
shutuphuman
LQ Newbie
 
Registered: Jan 2005
Posts: 11

Rep: Reputation: 0
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
 
Old 02-05-2005, 09:55 AM   #2
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 296

Rep: Reputation: 31
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.
 
Old 02-05-2005, 10:03 AM   #3
shutuphuman
LQ Newbie
 
Registered: Jan 2005
Posts: 11

Original Poster
Rep: Reputation: 0
this isnt helpful it is just a fire wall???? i dont want one as yet i wanna beable to share my internet connect!
 
Old 02-05-2005, 10:13 AM   #4
Infernal211283
Member
 
Registered: Nov 2004
Location: Mid. East / Israel
Distribution: Slackware 10.2, Gentoo
Posts: 157

Rep: Reputation: 30
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?
 
Old 02-05-2005, 10:15 AM   #5
shutuphuman
LQ Newbie
 
Registered: Jan 2005
Posts: 11

Original Poster
Rep: Reputation: 0
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
 
Old 02-05-2005, 10:16 AM   #6
nazir
Member
 
Registered: Apr 2002
Location: Poland, Gliwice/Pszczyna
Distribution: Mandrake, Slackware
Posts: 41

Rep: Reputation: 15
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.
 
Old 02-05-2005, 10:21 AM   #7
shutuphuman
LQ Newbie
 
Registered: Jan 2005
Posts: 11

Original Poster
Rep: Reputation: 0
ok, il give it a try the first line works fine

but it complins about the command iptables
any clues?
 
Old 02-05-2005, 10:21 AM   #8
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
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/
 
Old 02-05-2005, 10:23 AM   #9
nazir
Member
 
Registered: Apr 2002
Location: Poland, Gliwice/Pszczyna
Distribution: Mandrake, Slackware
Posts: 41

Rep: Reputation: 15
install iptables package
 
Old 02-05-2005, 10:27 AM   #10
Infernal211283
Member
 
Registered: Nov 2004
Location: Mid. East / Israel
Distribution: Slackware 10.2, Gentoo
Posts: 157

Rep: Reputation: 30


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.
 
Old 02-05-2005, 10:28 AM   #11
Infernal211283
Member
 
Registered: Nov 2004
Location: Mid. East / Israel
Distribution: Slackware 10.2, Gentoo
Posts: 157

Rep: Reputation: 30
go through the pdf i gave you, you'll know what to do.
 
Old 02-05-2005, 10:30 AM   #12
shutuphuman
LQ Newbie
 
Registered: Jan 2005
Posts: 11

Original Poster
Rep: Reputation: 0
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
 
Old 02-05-2005, 10:49 AM   #13
nazir
Member
 
Registered: Apr 2002
Location: Poland, Gliwice/Pszczyna
Distribution: Mandrake, Slackware
Posts: 41

Rep: Reputation: 15
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:
Code:
 whereis iptables
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
 
Old 02-05-2005, 11:21 AM   #14
shutuphuman
LQ Newbie
 
Registered: Jan 2005
Posts: 11

Original Poster
Rep: Reputation: 0
well hte cmmands are working fine now!!1

but unfortantly no hope of sharing the interenet as yet

more suggestions :-(?
 
Old 02-05-2005, 11:46 AM   #15
nazir
Member
 
Registered: Apr 2002
Location: Poland, Gliwice/Pszczyna
Distribution: Mandrake, Slackware
Posts: 41

Rep: Reputation: 15
maybe try to ping something from machine behind the nat
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
mandrake 10.1 sharing files and internet sharing xfiles_arram Linux - Networking 0 05-21-2005 02:22 PM
internet sharing LinuxRam Linux - Networking 8 09-09-2004 08:52 AM
internet sharing trace1918 Linux - Networking 3 11-18-2003 02:04 PM
File sharing and internet sharing mullet Linux - Networking 1 10-14-2003 01:30 PM
Internet sharing from OS X to RH 7.3 ZeratulsAvenger Linux - Networking 3 07-22-2003 08:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:28 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