LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 08-13-2005, 05:22 PM   #1
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843
Blog Entries: 1

Rep: Reputation: 30
Internet Connection Sharing


Ok. Me and buddy-of-mine are trying to get linux to share the connection just like windows XP can do...

We just switched eth1 and eth0, so the internet can be plugged on eth0 and eth1 just like normally you would have on a linux system (We are using kubuntu)

After rebooting, we had to re-enable eth0 to be connected to the internet (because neither would work) Now I got to find the iface's network configuration to make it work first shot... but anyways... moving on...

How do I get linux to share connection.... with no starch added or linux voodoo.

He's a little linux so pity for him

 
Old 08-13-2005, 09:03 PM   #2
carl.waldbieser
Member
 
Registered: Jun 2005
Location: Pennsylvania
Distribution: Kubuntu
Posts: 197

Rep: Reputation: 32
Re: Internet Connection Sharing

Quote:
Originally posted by mimithebrain
Ok. Me and buddy-of-mine are trying to get linux to share the connection just like windows XP can do...

We just switched eth1 and eth0, so the internet can be plugged on eth0 and eth1 just like normally you would have on a linux system (We are using kubuntu)

After rebooting, we had to re-enable eth0 to be connected to the internet (because neither would work) Now I got to find the iface's network configuration to make it work first shot... but anyways... moving on...

How do I get linux to share connection.... with no starch added or linux voodoo.

He's a little linux so pity for him

You will need to enable IP forwarding on kubuntu.
Code:
$ sudo sh
# echo "1" > /proc/sys/net/ipv4/ip_forward
Then you just need to set WinXP's default gateway to the IP address of the kubuntu machine's LAN interface. Kubuntu's routing table should be set up to route local traffic to the LAN NIC and Internet traffic to the Internet NIC.
e.g.
Code:
$ sudo route add -net 192.168.0.0 netmask 255.255.0.0 dev eth0
$ sudo route add -net 0.0.0.0 netmask 255.255.255.255 dev eth 1
Assuming the routing table starts empty, this says to sent all traffic for the 192.168.0.0 network to eth0, and all other traffic to eth1.
 
Old 08-13-2005, 09:20 PM   #3
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843
Blog Entries: 1

Original Poster
Rep: Reputation: 30
Talking thanks :D

EXCELLENT

exactly the answer I was looking for.
 
Old 08-14-2005, 11:06 AM   #4
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843
Blog Entries: 1

Original Poster
Rep: Reputation: 30
just another question.

how do I implement DHCP the local network?

(I doing all that remotly by SSH)
 
Old 08-14-2005, 12:54 PM   #5
carl.waldbieser
Member
 
Registered: Jun 2005
Location: Pennsylvania
Distribution: Kubuntu
Posts: 197

Rep: Reputation: 32
Quote:
Originally posted by mimithebrain
just another question.

how do I implement DHCP the local network?

(I doing all that remotly by SSH)
I am not an expert with that (never done it before), but you probably need to install the dhcp3-server package. Might require some configuration.

If you only have a couple IP addresses, I find it is easier to just assign static IPs.
 
Old 08-14-2005, 04:15 PM   #6
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843
Blog Entries: 1

Original Poster
Rep: Reputation: 30
:)

That was already done
I knew that much

However, the way these computers are made on the network makes DHCP a requirement. These Macs have been locked down with admin passwords that we do not know, and never will aquire (unfortunatly )

Using firestater caused invalid DHCP settings. Cating and greping syslog revealed that the configs were wrong causing the local ethernet card not to service DHCP.

I think I'll google a bit


I'll be using the same method to setup a small WiFi network.
 
Old 08-14-2005, 11:21 PM   #7
carl.waldbieser
Member
 
Registered: Jun 2005
Location: Pennsylvania
Distribution: Kubuntu
Posts: 197

Rep: Reputation: 32
You know, I was thinking about it today, and I recalled I forgot to tell you you had to set up IP Masquerading for your Ubuntu machine. What this does is that when packets come into the Ubuntu machine, it alters the headers so to machines on the Internet, it looks like the packets came from the Ubuntu machine. It tracks these connections, so when it gets a response, it sends it back to the right machine on the LAN.

Anyway, if you are using a firewall like Firestarter, that will have something built in that tells you how to do the IP Masquerading. If you just want to use netfilter/iptables, the command would be something like:

Code:
$ sudo iptables -t nat -P POSTROUTING DROP
$ sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
The first line says, the default policy of this chain should be to drop any packets.
The second line says that any packets destined for the eth1 (Internet) interface need to be masqueraded first.
 
Old 08-15-2005, 08:55 PM   #8
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843
Blog Entries: 1

Original Poster
Rep: Reputation: 30
Alright

Meanwhile, I need to find the cause of some crashes while DHCPD is running, if it has to do with my atheros card being in Ad-Hoc mode and if it's related to my friend's recent crash (the runlevel had unexpectedly changed, and DHCP was set to run. That would hang the computer when it would happen)

This is awfully complicated. But it leads to more knowledge and understanding.
 
  


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
Internet Connection Sharing explorer Mandriva 1 03-17-2005 07:25 PM
Internet connection sharing mark_booze Linux - Newbie 22 01-02-2004 01:37 AM
internet connection sharing Sathe Linux - Newbie 4 12-05-2001 09:59 PM
internet connection sharing Danobri Linux - Networking 14 07-22-2001 12:50 AM
Internet Connection Sharing qsilver Linux - Networking 1 07-19-2001 02:31 AM


All times are GMT -5. The time now is 07:21 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration