View previous topic :: View next topic |
Author |
Message |
therobot Apprentice


Joined: 07 Jun 2002 Posts: 256 Location: Canada
|
Posted: Thu Jun 13, 2002 2:33 am Post subject: Ok, total loss on internet sharing |
|
|
I'm trying to set up internet connection sharing, and I'm at just a total loss here. I've been trying to piece it together with stuff from all over this forum, but I just can't figure it out.
Would someone be able to help me out at all, explaining how to do it? Or is there somewhere I can go to get a simple explanation?
Any help would be greatly appreciated.
thanks. |
|
Back to top |
|
 |
delta407 Bodhisattva


Joined: 23 Apr 2002 Posts: 2876 Location: Chicago, IL
|
Posted: Thu Jun 13, 2002 3:43 am Post subject: |
|
|
What "internet connection sharing", exactly? What is your connection to the outside world? Do you have a private subnet? Are you routed, NAT-ed, or proxied? Or don't you have anything set up?
More information, please. |
|
Back to top |
|
 |
therobot Apprentice


Joined: 07 Jun 2002 Posts: 256 Location: Canada
|
Posted: Thu Jun 13, 2002 4:56 am Post subject: |
|
|
sorry. My setup is: I have DSL coming in through eth1, which uses DHCP to get an IP address, and I have a cable going from eth0 to a windows 2000 computer. I'm just wanting to share my connection with the other computer.
I'm not totally sure how to get it set up.... |
|
Back to top |
|
 |
mksoft l33t


Joined: 28 May 2002 Posts: 844
|
Posted: Thu Jun 13, 2002 5:24 am Post subject: |
|
|
Place somewere in your startup:
Code: | #This enables masquarding
iptables -A POSTROUTING -t nat -o eth1 -j MASQUERADE
# activate IP-Forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward |
You need to have support for masquareding in your kernel (compiled in or as modules). If you're using modules, don't forget to load them before.
And set the other computer's gateway to your machine (ip address of eth0. don't forget to set dns as well). _________________ There's someone in my head but it's not me - Pink Floyd |
|
Back to top |
|
 |
therobot Apprentice


Joined: 07 Jun 2002 Posts: 256 Location: Canada
|
Posted: Thu Jun 13, 2002 5:42 am Post subject: |
|
|
ok, i tried that, but i get these errors when starting up:
Code: | modprobe: Can't locate module ip_tables
iptables v1.2.6a: Can't initialize iptables table 'nat': Table does not exist(Do you need to insmod?)
Perhaps iptables on your kernel needs to be upgraded? |
I'm pretty sure i loaded iptables into my kernel, but i'm not sure what this error means? |
|
Back to top |
|
 |
mb Guru


Joined: 25 Apr 2002 Posts: 355 Location: Hessen | .de
|
Posted: Thu Jun 13, 2002 7:00 am Post subject: |
|
|
u have to recompile your kernel an add iptables support + needed modules like ftp... and full nat + masq
Networking options --->
IP: Netfilter Configuration --->
modprobe it before calling the script....
#mb |
|
Back to top |
|
 |
therobot Apprentice


Joined: 07 Jun 2002 Posts: 256 Location: Canada
|
Posted: Thu Jun 13, 2002 7:38 am Post subject: |
|
|
I already compiled my kernel that way...
what do i need to modprobe? |
|
Back to top |
|
 |
fbleagh Tux's lil' helper


Joined: 13 Jun 2002 Posts: 98
|
Posted: Thu Jun 13, 2002 11:48 am Post subject: |
|
|
did u compile them as modules or builtin ? |
|
Back to top |
|
 |
Rylan n00b

Joined: 08 May 2002 Posts: 41
|
Posted: Thu Jun 13, 2002 12:39 pm Post subject: |
|
|
You said you have a "cable" going from eth0 to the win2000 box. Is this a crossover cable? You can't just plug cat 5 into two nic's, you need to have one end go into a hub/switch (unless it's a crossover cable).
My first step, were I you-- would be to give each computer a nic with a 192.168.0.x/24 address (the /24 means the first 3 fields' numbers are set in stone. /8 would mean the first field is the only constant 10.x.x.x). Then cable them together and see if they can ping each other. If so, that means both ethernet cards are working, and can talk to each other.
Then step two, which other people are helping you with, is getting iptables working right. Let me know how it goes. |
|
Back to top |
|
 |
mb Guru


Joined: 25 Apr 2002 Posts: 355 Location: Hessen | .de
|
Posted: Thu Jun 13, 2002 1:04 pm Post subject: |
|
|
therobot wrote: | I already compiled my kernel that way...
what do i need to modprobe? |
for gateways, routers and servers it's a good idea to include this into the kernel and disable loadable module support for security reasons...
#mb |
|
Back to top |
|
 |
therobot Apprentice


Joined: 07 Jun 2002 Posts: 256 Location: Canada
|
Posted: Thu Jun 13, 2002 3:29 pm Post subject: |
|
|
yes, it is a crossover cable, and they can ping each other. |
|
Back to top |
|
 |
Al'Capone n00b


Joined: 30 Apr 2002 Posts: 70 Location: Toronto Canada
|
Posted: Sun Jun 16, 2002 2:48 pm Post subject: |
|
|
Quote: | I have DSL coming in through eth1, which uses DHCP to get an IP address |
eth1 gets its IP address from what DHCP server?? is the DSL CPE a Router??
if that is the case just buy a cheap hub and you are set to go plug in both your gentoo box and your Winblows 2000 machine to the hub.
If the DSL CPE is just a bridge then you need to enable routing support on your kernel under Network option TCP/IP firts and foremost!!! then you can go on configuring NAT , IPtables, and DNS of course you need to setup gentoo to provide dhcp services to your Winblows machine only if you plan to add more network nodes later on .
if all you have is one machine then no need for dhcp, or nat at all just do a static ip portmap to your winblows machine you do however need dns services on the winblows machine configured and the static entries of your winblows machine set up on your /etc/host and /etc/hostname configuration on the gentoo machine.
This could be overwhelming but have no fear head over to http://www.tldp.org/HOWTO/Net-HOWTO/ it is the linux network how to and browse through it for help.
Mind you the painless and quicker way to get your internet sharing going if you have a DSL bridge is to get a DSL router/switch like linksys or d-link or if you have an old 486 box sitting around with no harddrive but a floppy head over to http://www.coyotelinux.com/ and make your own it loads from floppy and it is quick and better than cisco
Hope that helped
Cheers _________________ if it aint broken..... then... what the heck are you waiting for? ...go mess with it and see if you can make it better |
|
Back to top |
|
 |
hamletmun Tux's lil' helper


Joined: 13 Jun 2002 Posts: 111 Location: Buenos Aires, Argentina
|
Posted: Sat Jul 06, 2002 7:38 pm Post subject: HOWTO - Make your Internet Connection Sharing to work |
|
|
HOWTO - Make your Internet Connection Sharing to work
From ISP to GENTOO - (eth0:DHCP or STATIC IP)
From GENTOO to WINDOWS - (eth1:192.168.0.1)
1.
insmod your.nic.module (i.e. "insmod 3c59x") for both nics if differ
2.
if your ISP uses DHCP, "dhcpcd eth0"
if static, "ifconfig eth0 your.static.ip netmask 255.255.255.0 gateway your.isp.gateway"
Now is time to configure the connection sharing
this is just for kenels greater than 2.4.x with iptables
1.
insmod iptables_nat
2.
echo 1 >/proc/sys/net/ipv4/ip_forward
3.
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
(if your linux uses eth0 to connect your isp)
4.
In the Windows Machine:
192.168.0.1 in the gateway
numbers from your /etc/resolv.conf in DNS server |
|
Back to top |
|
 |
sulu Guru


Joined: 21 May 2002 Posts: 399 Location: Dornbirn/Austria
|
Posted: Tue Jul 09, 2002 11:18 am Post subject: |
|
|
Fully ACK.
Thats exactly the same what i did and it works flawlessy. |
|
Back to top |
|
 |
thegazer Tux's lil' helper

Joined: 15 Jun 2002 Posts: 76 Location: Melbourne
|
Posted: Wed Jul 17, 2002 11:30 pm Post subject: |
|
|
uhhmmm..
I can't find iptables_nat which option I have to enable/modulize on the kernel config to have this?? |
|
Back to top |
|
 |
thegazer Tux's lil' helper

Joined: 15 Jun 2002 Posts: 76 Location: Melbourne
|
Posted: Thu Jul 18, 2002 4:19 pm Post subject: |
|
|
oops my bad
got it solved
thanks! |
|
Back to top |
|
 |
870Fragmaster Tux's lil' helper


Joined: 01 Jul 2002 Posts: 92 Location: Gulfport, Ms
|
Posted: Sun Jul 21, 2002 5:53 am Post subject: |
|
|
how do I use the iptables init script? Where do you put the rules and what are the rules? |
|
Back to top |
|
 |
WarMachine Apprentice

Joined: 15 Jul 2002 Posts: 181
|
Posted: Sat Aug 03, 2002 1:25 am Post subject: |
|
|
I use PPPoE, so the interface that I actually connect with is ppp0. Would I set
to ppp0, or eth0, my guess is ppp0 but not sure
also, my ISP is refusing to give me the IP of my DNS server, saying it's assigned "dynamically" on logon. Is there any way I can find it so I can specify in resolv.conf and on the windows machines? (I use bellsouth from central florida) |
|
Back to top |
|
 |
sciack Tux's lil' helper


Joined: 19 Jun 2002 Posts: 120 Location: Genoa, Italy.
|
Posted: Sat Jun 21, 2003 6:53 pm Post subject: |
|
|
Hi all,
please help me as well. I got another situation.
192.168.0.1 my linux box with a speedtouch adsl (ip gotten through dhcp) on ppp0
192.168.0.20 winxp
192.168.0.30 win98
i have set them with gateway 192.168.0.1 i have enabled iptables with the forwarding but it still doesnt work at all. i cannot ping from my windows machines.
I have just a eth0 connected to a switch such as all the other windows machines.
help me!
 _________________ the sciack |
|
Back to top |
|
 |
cato` Guru


Joined: 03 Jun 2002 Posts: 430 Location: Norway, Trondheim
|
Posted: Sat Jun 21, 2003 7:15 pm Post subject: |
|
|
LinWall is a firewall using linux-2.4-kernels iptables. Iptables is a packet filter supporting the use of NAT. This way you will have full control of what you do with what packets while you in the same time have the possibility to share your internet-connection with your LAN. Of course you can run LinWall on a stand-alone machine, or a transparent firewall (with certain modifications). LinWall is perfect for home-users and small offices, both with static and dynamic IP.
Features
The newest release (v2.6) has the following features:
* NAT (sharing of internet-connection)
* Open/close UDP and TCP ports
* Port-forwarding UDP and TCP ports
* State-full inspection of packets (like in FTP)
* Support for many internal networks
* Protects against an attack towards certain Alcatel DSL-modems
* Nice for both dynamic and static connections
URL: http://www.linnet.no/firewall/
It's really simple, but you still need the iptables stuff in your kernel! |
|
Back to top |
|
 |
Braempje l33t


Joined: 31 Jan 2003 Posts: 748
|
Posted: Sun Jun 22, 2003 6:56 am Post subject: |
|
|
WarMachine wrote: | I use PPPoE, so the interface that I actually connect with is ppp0. Would I set
to ppp0, or eth0, my guess is ppp0 but not sure
also, my ISP is refusing to give me the IP of my DNS server, saying it's assigned "dynamically" on logon. Is there any way I can find it so I can specify in resolv.conf and on the windows machines? (I use bellsouth from central florida) |
The interface is ppp0, eth0 doesn't work.
About your dns: it will be in your resolv.conf whenever you make a connection (if you have specified it in the setup of the adslpackage).
I also have an isp who assigns his dns automatically, but I know that if you take to dns servers fixed, most of the time you have them all... They don't change that often because most isps also have dialup users, and they don't have a dynamic dns facility (I think). _________________ Dictionary of the Flemish Sign Language - Woordenboek Vlaamse Gebarentaal |
|
Back to top |
|
 |
tgoodaire Tux's lil' helper


Joined: 31 Jan 2003 Posts: 145 Location: Dartmouth, Nova Scotia, Canada
|
Posted: Mon Jun 23, 2003 3:37 pm Post subject: |
|
|
mb wrote: | therobot wrote: | I already compiled my kernel that way...
what do i need to modprobe? |
for gateways, routers and servers it's a good idea to include this into the kernel and disable loadable module support for security reasons...
#mb |
What security reasons? You need to be root to load a kernel module. If someone has hacked root on your gateway, router, or server, it's game over anyway. _________________ I bent my wookie. |
|
Back to top |
|
 |
HeadHolio Guru


Joined: 10 Aug 2002 Posts: 445
|
Posted: Sat Nov 29, 2003 6:22 pm Post subject: Re: HOWTO - Make your Internet Connection Sharing to work |
|
|
hamletmun wrote: | HOWTO - Make your Internet Connection Sharing to work
From ISP to GENTOO - (eth0:DHCP or STATIC IP)
From GENTOO to WINDOWS - (eth1:192.168.0.1)
1.
insmod your.nic.module (i.e. "insmod 3c59x") for both nics if differ
2.
if your ISP uses DHCP, "dhcpcd eth0"
if static, "ifconfig eth0 your.static.ip netmask 255.255.255.0 gateway your.isp.gateway"
Now is time to configure the connection sharing
this is just for kenels greater than 2.4.x with iptables
1.
insmod iptables_nat
2.
echo 1 >/proc/sys/net/ipv4/ip_forward
3.
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
(if your linux uses eth0 to connect your isp)
4.
In the Windows Machine:
192.168.0.1 in the gateway
numbers from your /etc/resolv.conf in DNS server |
hamletmun: Those are the easiest and most helpful instructions I have seen on getting internet connection sharing to work. Thank you. |
|
Back to top |
|
 |
anil_et Tux's lil' helper


Joined: 22 Jul 2002 Posts: 98
|
Posted: Tue Dec 16, 2003 10:06 am Post subject: |
|
|
Hi All
Here I am in trouble
when I do Code: | echo 1 >/proc/sys/net/ipv4/ip_forward
|
getting error
Code: | puppy anil # echo "1" > /proc/sys/net/ipv4/ip_forward
bash: /proc/sys/net/ipv4/ip_forward: No such file or directory |
What could be wrong ?
my lsmod shows
Code: | Module Size Used by
appletalk 28640 1 (autoclean)
ipx 23864 1 (autoclean)
floppy 53596 0 (autoclean)
ipt_MASQUERADE 1656 1 (autoclean)
af_packet 16488 1 (autoclean)
rtc 8136 0 (autoclean)
iptable_nat 18950 1 [ipt_MASQUERADE]
ip_conntrack 22524 1 [ipt_MASQUERADE iptable_nat]
ip_tables 13568 4 [ipt_MASQUERADE iptable_nat]
fglrx 174440 206
sr_mod 16024 0 (unused)
cdrom 25220 0 [sr_mod]
ide-scsi 10672 0
sg 30076 0 (unused)
sd_mod 11276 0 (unused)
i810_audio 27164 1
ac97_codec 14040 0 [i810_audio]
soundcore 4612 2 [i810_audio]
uhci 28412 0 (unused)
hid 21988 0 (unused)
input 3968 0 [hid]
usb-storage 124432 0 (unused)
usbcore 69292 1 [uhci hid usb-storage]
scsi_mod 63924 4 [sr_mod ide-scsi sg sd_mod usb-storage]
e100 53128 1
3c59x 27664 1
|
Pls help me
Anil |
|
Back to top |
|
 |
|