View Full Version : Howto Share internet connection
anaoum
November 17th, 2005, 03:53 AM
Hello,
The following will explain how to share your Internet connection:
Note: Type all the following commands in a root terminal, DO NOT use sudo.
1. Start by configuring the network card that interfaces to the other computers on you network:
# ifconfig ethX ip
where ethX is the network card and ip is your desired server ip address (Usually 192.168.0.1 is used)
2. Then configure the NAT as follows:
# iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
where ethX is the network card that the Internet is coming from
# echo 1 > /proc/sys/net/ipv4/ip_forward
3. Install dnsmasq and ipmasq using apt-get:
# apt-get install dnsmasq ipmasq
4. Restart dnsmasq:
# /etc/init.d/dnsmasq restart
5. Reconfigure ipmasq to start after networking has been started:
# dpkg-reconfigure ipmasq
6. Repeat steps 1 and 2.
7. Add the line "net.ipv4.ip_forward = 1" to /etc/sysctl.conf
# gedit /etc/sysctl.conf
8. Reboot. (Optional)
I hope this helps.
Good luck!
Squirreli
November 17th, 2005, 06:19 PM
By following your instructions (after a long while spent at the ages-old art of trial-and-error ;) I got as far as this:
eth0 connects me to the Internet.
eth2 connects me to my winxp machine.
ping gets reply both ways and my winxp is hosting ftp server which is reachable.
winxp firewall is disabled (just in case)
Xp machine, however, does NOT reach Internet. Possible reason for this could be in the way I've set up the xp machine's networking. You did not give specifics as to how those should be set up, but I've tested both fixed ip and DHCP. Also, the networking adapters and cables im using are reliable... Any ideas?
-Squirreli
PS. I do have a slight virus problem on the XP machine's lsass.exe, but it connects to Internet just fine when there's no linux box between it and the Internet, so I don't believe that to be the trouble.
anaoum
November 18th, 2005, 01:00 AM
Hello,
On your winxp machine configure it with a static ip (make it similar to the ip on your server. eg if server ip is 192.168.0.1, then make your ip 192.168.0.10). Also make sure that you set the "Default Gateway" and "Preffered DNS" to the ip on your ubuntu machine (the one that's sharing the internet connection). It should work fine after that.
Good luck
Squirreli
November 18th, 2005, 04:29 PM
Ha! Now it works.
Setting default gateway didn't help, but didn't do any harm either. Setting preferred DNS server did the trick... So, these XP comp tcp/ip settings made it work.
-fixed ip:192.168.0.1 (subnet mask 255.255.255.0)
-default gateway:192.168.0.2
-preferred DNS server:192.168.0.2
Paljon kiitoksia/Thank you very much ;)
-Squirreli
anaoum
November 18th, 2005, 05:57 PM
No worries. I'm glad it has helped!
nicholaspaul
December 4th, 2005, 04:51 AM
I'm having some fun with this -
set up is a PPC laptop that needs the internet from a x86 desktop (which gets the internet with ath0 , a wifi adapter, and is sharing with eth0), both running Breezy. Is it a matter of just changing Network settings?
So far, the laptop can ping x86 when static IP and DNS is set to the x86 IP (192.168.0.2), but cant get to the internet. Also x86 cant get to the internet while eth0 is activated .
Should I also change submasks?
PLUS when I restart dnsmasq I get :
Restarting DNS forwarder and DHCP server: dnsmasqstart-stop-daemon: warning: failed to kill 8006: Operation not permitted
rm: cannot remove `/var/run/dnsmasq.pid': Permission denied
dnsmasq: failed to bind listening socket: Permission denied
(failed to start).
I'm also using a crossover cable - thats right isnt it?
anaoum
December 4th, 2005, 07:26 AM
Hello nicholaspaul,
Make sure that the subnet masks on your ppc are set to 255.255.255.0.
Also make sure that the Default Gateway on the ppc is set to the ip of the x86 (192.168.0.2)
About restarting dnsmasq, are you sure you are executing the command as root user?
nicholaspaul
December 4th, 2005, 02:42 PM
Hi anaoum
Yea... :( tried all that. x86 still can't get to the internet unless I deactivate eth0 even tho ath0 is the default gateway device.
So the full story is:
x86
ath0:
Static IP: 192.168.0.102
Subnet: 255.255.255.0
Gateway Address: 192.168.0.1 [the address of my wireless router]
eth0:
Static IP: 192.168.0.2
Subnet: 255.255.255.0
Gateway Address: 192.168.0.1
Default Gateway Device: ath0
PPC Laptop
eth0:
Static IP: 192.168.0.2
Subnet: 255.255.255.0
Gateway Address: 192.168.0.2
DNS: 192.168.0.102
Search domain: home (the name of the intranet)
---------------------------------------------------
Should I change search domains on the PPC?
nicholaspaul
December 4th, 2005, 02:51 PM
2. Then configure the NAT as follows:
# iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
where ethX is the network card that the Internet is coming from
# echo 1 > /proc/sys/net/ipv4/ip_forward
Oh wait a minute - should ethX be the interface that gets x86 the internet, or the one I'm sharing with?
varunus
December 4th, 2005, 06:51 PM
The Firestarter firewall can do all of this for you, by the way...
sudo apt-get install firestarter
Its just a frontend to iptables.
In its preferences, set "internet connected device" to the internet, and "local network device" to the local device. Then enable NAT and DHCP if you want...
anaoum
December 5th, 2005, 01:36 AM
Oh wait a minute - should ethX be the interface that gets x86 the internet, or the one I'm sharing with?
When executing this command : # iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
You should use ath0 instead ethx, as it is the network interface that your internet connection is comming from.
stole_mkd
December 25th, 2005, 04:08 PM
Well, i have this big problem. I set up my Ubuntu Pc ( wich has two network cards, one for the internet(eth0) and one for my other XP Pc(eth1)) with masqurade from a forum (http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/) but still can't get the xp to get to the internet. Then i saw this forum. Much easyier. But, i cannot download the dnsmasq or the other mentioned file in the tuttorial. Can someone please explain me where to download how to install the files and can the setup i made before get in the way of getting the other computer to the internet. Please.
hatstand
January 3rd, 2006, 11:30 PM
Right. Tried all that. Didn't work, though I appreciate your efforts.
Here's my problem. I run Ubuntu and the wife runs XP. We have one wired cable internet connection. We want to share it. I naively thought that buying a switch would simply give me some and her some. Well, whichever computer boots forst gets the connection and the other has none (although XP states "limited connectivity but doesn't connect to anything").
So I looked here. I first ran Firestarter. Great but you cannot have eth0 as both "internet connected Device" and "local network connected device". It instead detects something called sit0 that it promptly says is not ready. I can't find any onformation on how to make it ready.
I installed samba: no change.
Then I tried this handy thread. It assumes that you can have a static IP address. I apparently cannot: as soon as I set a static IP address (192.168.0.1) and the (255. thing follows automatically), I lose the internet, even after reboot. If I change it back to DCHP it works immediately.
SO the question is: how do I get the XP box to access the internet when I am accessing it on ubuntu?
My connection goes like this:
cable modem --- switch --- ubuntu + XP
anaoum
January 4th, 2006, 01:46 AM
Hello,
You have got this set up completely wrong. It is ment to be:
Cable Modem >> Ubuntu >> Switch >> XP
And you must make sure that your ubuntu pc has two network interfaces (one to the modem, and another to the switch).
The way you are currently trying to set up, you could simply use a router instead of a switch:
Cable Modem >> Router >> XP + Ubuntu
This is a lot easier(no need to install any client software), however you must purchase a Router.
Tell me which configuration you would prefer and i can help you out...
anaoum
January 4th, 2006, 01:51 AM
Well, i have this big problem. I set up my Ubuntu Pc ( wich has two network cards, one for the internet(eth0) and one for my other XP Pc(eth1)) with masqurade from a forum (http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/) but still can't get the xp to get to the internet. Then i saw this forum. Much easyier. But, i cannot download the dnsmasq or the other mentioned file in the tuttorial. Can someone please explain me where to download how to install the files and can the setup i made before get in the way of getting the other computer to the internet. Please.
Make sure you have set up your repositories correctly: http://help.ubuntu.com/starterguide/C/faqguide-all.html#addinguniverse
hatstand
January 4th, 2006, 03:08 AM
Hello,
You have got this set up completely wrong. It is ment to be:
Cable Modem >> Ubuntu >> Switch >> XP
And you must make sure that your ubuntu pc has two network interfaces (one to the modem, and another to the switch).
The way you are currently trying to set up, you could simply use a router instead of a switch:
Cable Modem >> Router >> XP + Ubuntu
This is a lot easier(no need to install any client software), however you must purchase a Router.
Tell me which configuration you would prefer and i can help you out...
NOW I see!
However, there is only one ethernet entrance to the inux machine.:-(
I tried it with the USB entrance but although it recognised a "eth1", it did not work under static or DHCP.
anaoum
January 4th, 2006, 03:20 AM
So now you have two options:
1. Buy a new Ethernet card for your ubuntu pc.
2. Buy a router.
I think a router is much simpler to set up. however buying a new ethernet card is cheaper...
it's your decision...
hatstand
January 4th, 2006, 03:24 AM
So now you have two options:
1. Buy a new Ethernet card for your ubuntu pc.
2. Buy a router.
I think a router is much simpler to set up. however buying a new ethernet card is cheaper...
it's your decision...
Not what I wanted to hear, but thanks anyway. think I'll do a bit of searching to see if I can use the USB port for the modem before splashing out $140!
anaoum
January 4th, 2006, 03:58 AM
Not what I wanted to hear, but thanks anyway. think I'll do a bit of searching to see if I can use the USB port for the modem before splashing out $140!
A free ethernet card shouldnt be that hard to find, and even if you were to buy one, it wouldnt cost much more than $15.
A router is a little more expensive, but not as expensive as $140. You should be able to find one for about $50.
Check out:
http://www.radioshack.com/product/index.jsp?productId=2104283&cp=&pg=2&kw=ethernet+card&parentPage=search
and
http://www.radioshack.com/product/index.jsp?productId=2117844&cp=&pg=1&y=8&kw=router&x=14&s=A-StorePrice-RSK&parentPage=search
Good luck!
stole_mkd
January 4th, 2006, 02:18 PM
Make sure you have set up your repositories correctly: http://help.ubuntu.com/starterguide/C/faqguide-all.html#addinguniverse
Well, i tried that, didn't work, reinstalled it, and did that again, didn't work. I have another information that i didn't shared before. If i don't add these lines there is no internet. In order that i add them:
1. ifconfig eth0 down hw ether 00:0B:6A:9A:FA:AE
2.ifconfig eth0 up
3.route add default gw 172.19.0.1 dev eth0
after that i have internet, but the XP still does not have internet.
Need some help. PLEASE.
stole_mkd
January 4th, 2006, 03:49 PM
Got some luck. Now, when i ping google.com from my XP it resolves it's address but doesen't get pong or replay. It say's Request timed out. How to set up completly the XP computer and the Ubuntu. Where do u think is the problem.
anaoum
January 4th, 2006, 09:04 PM
Hello,
On your XP machine make sure that you set the "Default Gateway" and "Preffered DNS" to the ip on your ubuntu machine. If you could ping google, then you have connection to the internet, but XP doesent know.
hatstand
January 5th, 2006, 12:11 PM
A free ethernet card shouldnt be that hard to find, and even if you were to buy one, it wouldnt cost much more than $15.
A router is a little more expensive, but not as expensive as $140. You should be able to find one for about $50.
Check out:
http://www.radioshack.com/product/index.jsp?productId=2104283&cp=&pg=2&kw=ethernet+card&parentPage=search
and
http://www.radioshack.com/product/index.jsp?productId=2117844&cp=&pg=1&y=8&kw=router&x=14&s=A-StorePrice-RSK&parentPage=search
Good luck!
Unfotunately in Mexico the prices are MUCH higher: radioshack only do one router which is $1400MN ($140US) and steren do one for $130US. Que lástima. Voy a buscar una tienda de computación para comprar una tarjeta de ethert, supongo.
hatstand
January 7th, 2006, 05:36 PM
Hello,
You have got this set up completely wrong. It is ment to be:
Cable Modem >> Ubuntu >> Switch >> XP
And you must make sure that your ubuntu pc has two network interfaces (one to the modem, and another to the switch).
The way you are currently trying to set up, you could simply use a router instead of a switch:
Cable Modem >> Router >> XP + Ubuntu
This is a lot easier(no need to install any client software), however you must purchase a Router.
Tell me which configuration you would prefer and i can help you out...
OK. I bought and installed an ethernet card (the cheapest wired router here in Mexico is $140 US), so now my Ubuntu box has 2 ethernet cards. They both work on DHCP.
My set up is now:
Cable Modem>>>>Ubuntu eth0>>Ubuntu eth1>>>>Switch>>>>XP Box
All with straight through cables (apart of course from eth0 to eth1!)
Windows XP fins a connection but cannot connect to the internet. When i run ifconfig I get this:
eth0 Link encap:Ethernet HWaddr 00:A1:B0:00:48:28
inet addr:10.135.1.97 Bcast:10.135.31.255 Mask:255.255.224.0
inet6 addr: fe80::2a1:b0ff:fe00:4828/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19110 errors:0 dropped:0 overruns:0 frame:0
TX packets:1051 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1952135 (1.8 MiB) TX bytes:140228 (136.9 KiB)
Interrupt:16 Base address:0xa000
mat@ubuntu:~$ ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:11:2F:2C:2D:51
inet6 addr: fe80::211:2fff:fe2c:2d51/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:70 errors:0 dropped:0 overruns:0 frame:0
TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10816 (10.5 KiB) TX bytes:7560 (7.3 KiB)
Interrupt:23 Base address:0xe400
Do I need a static IP address?
hatstand
January 7th, 2006, 09:39 PM
BUMP!
Please help! I'm going mad!
Using Firsetarter, I can now ping both computers. My eth0 connects to the cable modem. My eth1 gives this under ifconfig eth1:
eth1 Link encap:Ethernet HWaddr 00:11:2F:2C:2D:51
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::211:2fff:fe2c:2d51/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:242 errors:0 dropped:0 overruns:0 frame:0
TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32907 (32.1 KiB) TX bytes:3812 (3.7 KiB)
Interrupt:23 Base address:0xe400
Where I assigned the address myself.
So the computers are communicating, it seems. So why can't Internet Explorer on the XP box access the internet?
Please help!
hatstand
January 7th, 2006, 11:57 PM
and then it magically worked...
Didn't change anything: I think it just needed time to get t's little head around the fact that it's sharing.
zappa86
January 8th, 2006, 01:53 AM
I have an ssh server on my computer. and after I did the internet connection sharing I can not ssh into it. what must I do?
My network is set up with a router that connects to the internet. The router has wireless which goes to 2 computers (including the one which I want to ssh from). The router also has a hub which goes to my main computer which I did the ip forwarding on. that computer has 2 eth cards on it. From the 2nd card, it goes into a hub and goes to 2 old POS computer. After I enabled the ip forwarding I can not ssh from a computer connected to the wireless router to my main computer, or either of the 2 POS computers behind it. However the 2 computers behind my main one (and itself) can both access the internet. Lastly, my main computer can ping the 2 old computers behind it, however it can not ping my wireless router (which it could before) or the other computers connected by wireless.
stole_mkd
January 8th, 2006, 03:59 PM
Can anyone tell me what information do u need me to put here so u can see what the problem might be.
dcstar
January 29th, 2006, 11:53 PM
Hello,
The following will explain how to share your Internet connection:
........
# echo 1 > /proc/sys/net/ipv4/ip_forward
........
And if you want this to "stick" after a reboot, edit /etc/sysctl.conf and add the following line:
net.ipv4.ip_forward = 1
anaoum
January 30th, 2006, 12:16 AM
And if you want this to "stick" after a reboot, edit /etc/sysctl.conf and add the following line:
net.ipv4.ip_forward = 1
i have never had to do this. but if you think it is neccasary i will add it to the how to.
Chris Tucker
February 11th, 2006, 12:26 PM
does this pass DHCP through? in my setup this is going to be essential.
DHCP server (10.251.81.254 i believe, not positive) --> only one cat5 rout available -> (eth0) linux system for serving some audio/timekeeping purposes -> (eth1) linux system for serving some audio/timekeeping purposes -> windows XP machine that MUST get its IP from 10.251.81.254, and no i dont mean spoofed. the windows systems on this network in question are all on a domain, run by a remote admin, so no configs can be changed on those, so everything must pass through...
i would check myself but i am not at that setup right now, its the weekend.. ive been trying to mockup this setup but so far unsuccessfull because one of the nics i have here at home is causing problems, picking up another today.
anaoum
February 11th, 2006, 08:08 PM
This will not pass through DHCP. Since you have a DHCP server i suggest you buy a switch.
Chris Tucker
February 11th, 2006, 09:09 PM
This will not pass through DHCP. Since you have a DHCP server i suggest you buy a switch.
there are dozens of switches on that net, but the building will not shell out money just to give this one system net access...
perhaps i could make it work O.K. with a static ip.. but i must ask, will this block any standard traffic? like if the PC is transferring files via windows shares through the linux box bridge, to a server named lets say //SWIFT ... would that get interrupted? thats the biggest thing... aswell as domain logins... allthough i dont know if that computer is set up to either.. id have to check it out. long story short that box needs to have complete and uninterrupted access to the network... the software that the secretary runs on that system i cant imagine binds itself to any ports for inbound connections, as very very VERY few ports are forwarded inside this place, only things like VNC to 8 computers, and vidphone/vidphone remote admin. so i dont think that will cause a problem.
i'll try it anyway.
Rizado
February 12th, 2006, 05:22 AM
Using Firehol makes configurating iptables so much easier.
tymczas
March 4th, 2006, 04:32 AM
How can I set this internet connection sharring automaticly (I am asking about the first post in this topic)? I am using Xubuntu 5.10
halfbakedntx
March 8th, 2006, 01:32 PM
This was hugely helpful for me thanks!
I bought a cheap Fry's 1 day special GQ PC for 99.00 LOL.. Update the Ram to 392 megs for 30 bux. Bought an Airlink 101 AWLH4030 Wireless Super G PCI card for get this $17.99 (again onsale). Ubuntu detects it immidiately on install. SHWEET! So this GQ pc is plugged in behind my entertainment center. I VNC into it and have the sound card plugged into the RCA input on my stereo. I use StreamTuner to listen to ShoutCasts through the Stereo and record them to Mp3 with Streamripper. Create playlists in XMMS and basically have a jukebox I VNC into from the laptop at the coffee table or Kitchen to play tunes. I plugged in my 250 Gig Maxtor loaded with MP3s and add to the collection recording Shoutcasts.. SWEET! I plan to order a touch screen monitor add on and build a touchscreen interface at the entertainment center to make playlists/downloads there. Gotta find a nice Mp3 jukebox heh.. Ontop of all that I plug in my Xbox into the built in NIC on the 99.00 GQ PC and followed your instructions to route it to the wireless Netgear gateway. I have a verizon FiOS Fiber ISP connect 15mbs down 2mbs up. The damn Xbox wireless nic was 99.00 in itself. Needless to say THIS IS A SHWEET setup. Again thanks for the help! ;-)
george.aprozeanu
March 24th, 2006, 02:46 PM
I managed to get it working without the "ipmasq" package. I understand that "dnsmasq" would enable me to act as a nameserver proxy, but what does ipmasq do (that -j MASQUERADE doesn't do) ?
Other than that, excelent job... worked like a dream!
LordMerlin
March 27th, 2006, 10:15 AM
Hello everyone!
I got the iBurst up and running, with the pppoeconf command :)
So, I setup Linux as a PDC, DHCP, caching DNS server, and want it to route internet traffic for the LAN
My setup is as follows:
iBurst Modem (pppoe connection - get's IP from ISP - 196.2.108.xxx)
|
|
|
eth0 (192.168.0.2)
||
Linux box
||
eth2 (192.168.10.1 - running DHCP)
|
|
|
24 port hub
| | | | |
XP PC 1 XP PC 2 XP PC 3 etc etc
The XP PC's can ping 192.168.10.1 & 192.168.0.1, but not 196.2.108.xxx, nor for example google.com. I tried running
"iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE", but that doesn't seem todo anyting. In fact, I followed the Howto Share internet connection
Can somone please assit me with this?
B0rsuk
March 29th, 2006, 03:27 PM
And if you want this to "stick" after a reboot, edit /etc/sysctl.conf and add the following line:
net.ipv4.ip_forward = 1
For some reason it doesn't work for me.
I use ethernet connection with 2 eth cards and a gateway. I did it right after fresh reinstall, because I messed something up last time and couldn't fix it. *
I did it exactly as described in first post, and the connection is shared...
... but it's gone as soon as I restart. I have to type these commands from root each time, and it got old quickly. What could possibly be wrong ? How to nail it down ?
* I had to reinstall, because I used "ifconfig eth0 192.168.0.1" instead of "ifconfig eth1 192.168.0.1". As a result, I destroyed my own connection instead of sharing it. I tried to fix it using both GUI from system settings and some old Debian manual. Now it's fixed, because I reinstalled Kubuntu... But how do I fix such humiliating mistake in the future ?
rcmiv
March 29th, 2006, 10:28 PM
Hello,
The following will explain how to share your Internet connection:
<snip>
I hope this helps.
Good luck!
anaoum -
Great information. Worked perfectly on my network, which is no standard setup.
I use a usb cable modem, and after several failed attempts, I have never bothered to drill down to get it working properly in linux. After reading this thread, I tossed a Dapper FL5 Live CD into the machine which connects to the internet (and still runs win98 so I can use proxy+ share internet - no longer!), and after running through these steps, and modprobing the proper modules for usbnet, I was off. (ten minutes)
Fantastic. Brilliant. You have no idea how helpful this is. For this family network it is literally a paradigm shift. Being no networking guru (and having little interest in learning the sqeaky details), I have been proxy serving internet to all of my machines for years, and it's been a real wicked pain.
Wow. Thanks.
-rcmiv
dcast
March 30th, 2006, 05:48 PM
I had a couple of questions. Am I right in thinking that i would be able to share to more than one computer say one ubuntu and one windows. Also could i do this if I had a usb modem (dsl). Also I dont have a static IP but that won't affect this will it?
rcmiv
April 1st, 2006, 12:40 PM
I had a couple of questions. Am I right in thinking that i would be able to share to more than one computer say one ubuntu and one windows. Also could i do this if I had a usb modem (dsl). Also I dont have a static IP but that won't affect this will it?
Yes. You have to have an ethernet card in your pc in addition to your cable modem.
I did a fresh install of dapper FL6 on a machine last night and was able to see my usb cable modem as eth1 and my network card as eth0.
I was then able to activate eth1 (the cable modem) with the following:
sudo /sbin/modprobe usbnet
sudo /sbin/modprobe cdc-acm
NOTE: these commands did _not_ work for me on breezy. Breezy saw only one eth device which was my network card, and I could not get the cable modem to function.
Then I followed the steps in this thread to setup iptables, and voila, all of the machines on my network (windows and linux) on the same hub were able to direct connect to the internet by using the newly installed machine as a router.
The steps in this thread have you set the cable modem eth device to use DHCP to establish ip, in other words it obtains the ip from your isp, and you set the network card to a static ip for the other comps on your network to use.
Brilliant.
-rcmiv
calcium79
April 14th, 2006, 03:18 AM
Um, okay, I have a weirder situation...
___________________-> Dads Windows PC
ADSL modem -> router
___________________-> My Ubuntu PC -> My Windows PC
I did this guide and the net works through all pcs no problem. My Windows PC can share files with my Ubuntu PC. My Ubuntu PC can share files between my dads PC and my Windows PC. My Dads PC can share files with my Ubuntu PC. However, my Dads PC cannot reach my Windows PC, or vice versa.
Is there something else I need to add onto this?
tomski
April 14th, 2006, 08:17 AM
Hi all,
i was wondering if any of you guys had tried a similar approach to this using a bridge/firewall (server install of ubuntu with shorewall) on the linux box that shares the connection;
i have successfully set up a router/firewall with a linux box but i need a few pointers with a bridge setup, i have tried it but i think i got it wrong because i could not see the internet from behind the bridge i followed the instructions in the shorewall pdf but no joy
any suggestions
pjebr
April 27th, 2006, 07:11 PM
Hi,
I did these steps and my computer with windows cant access the internet... just some sites like Google. For example, i cant access www.globo.com... but i can ping this site.
In the another computer (with linux) i can access any site without problems. So, what i did wrong?
My network is like this:
Linux (computer with adsl and 2 network cards)
eth0
ip: xxx.xxx.xxx.xxx
subnet mask: 255.255.0.0
gateway: xxx.xxx.xxx.xxx
eth1
ip: 192.168.0.1
subnet mask: 255.255.255.0
Windows
eth0
ip: 192.168.0.2
subnet mask: 255.255.255.0
gateway: 192.168.0.1
LordMerlin
April 28th, 2006, 03:30 AM
What does your routing table on Linux look like? And can you run a tracert to say google.com on your windows box?
From linux:
route -nv
From windows:
tracert google.com
And does your ADSL have NAT?
pjebr
April 28th, 2006, 07:19 PM
Result of route -nv
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
201.14.143.254 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 201.14.143.254 0.0.0.0 UG 0 0 0 ppp0
I just tried to access some sites in my windows machine and now its just working fine :confused:
I dont know why wasnt working before... btw, when i restart my computer i need to run "pon dsl-provider" in the terminal... and i configured to start in boot. How can i fix it?
Ah, i forgot to say... my modem is bridge... this will afect something?
CameronCalver
April 29th, 2006, 09:38 PM
Hey this is my problem i have a home computer which runs breezy and it has an eth card which a cable goes to a 7 port hub then i have a computer which i just made which also has a cable going to the hub and it runs breezy 2 and the home computer has a ktx extenal dial up modem which connects to computer via serial port and i would like to share internet any1 no how i would do it and i dont no the ip address or anything of any of the computers can some1 help me
mybers
April 30th, 2006, 03:24 AM
Hello,
On your winxp machine configure it with a static ip (make it similar to the ip on your server. eg if server ip is 192.168.0.1, then make your ip 192.168.0.10). Also make sure that you set the "Default Gateway" and "Preffered DNS" to the ip on your ubuntu machine (the one that's sharing the internet connection). It should work fine after that.
Good luck
Hello
Kinda still new on this so i hope ud help me as well on this.
Im connected to a wifi/DSL line with gives me a Dynamic IP to my ubuntu (internet sharing server). I followed the earlier post and it did installed everything i hope.
This Ubuntu PC connects to the internet nicely but my Winxp and other Linux PC wont have any access yet. Probably still having problems with what is the right settings I should set up on those workstations?
My eth1=connects to the DSL (set to DHCP), Default gateway
eth0= connects to the LAN network (set to DHCP)
what should I set in for the Winxp Lan card?
How can I get /validate the DNS server and or the Gateway?:-k
Thanks a lot! hope this post is understandable...:)
mybers
sheila
May 8th, 2006, 08:05 AM
hi!!! to tell you the truth, i don't have that much knowledge in networking so please explain to me in simple terms with regards to my problem. i hope you can help me with this.here it is.
we set-up a LAN in our office but the Internet service provider only gave us 1 ip add so the entire network is using only 1 ip add. Now, my boss wanted each pc to have a unique ip add. I tried to reconfigure the router but the result is i cant connect to the internet..
what is the step by step procedure in configuring the router so that each pc can have its own ip add...?
pls help!!!
thanks!!
tuga
May 16th, 2006, 04:27 PM
Thank you anaoum.
After checking "how to start a root shell" with:
sudo -i
I followed your howto and it just worked perfectly.
Braynid
May 26th, 2006, 02:17 PM
Hello,
I have followed the How to until
Install dnsmasq and ipmasq using apt-get:
# apt-get install dnsmasq ipmasq
Then i get:
apt-get install dnsmasq
Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package dnsmasq
I really don't know where i could find dnsmasq or ipmasq.
Thanks.
anaoum
May 26th, 2006, 07:54 PM
make sure you have all the repos enabled
smoothunit
May 31st, 2006, 08:51 PM
Hi guys,
Ive followed the fantastic guide on page 1 of this thread and am still experiencing a slight problem.
My windows box can only connect to IP's and not names ie www.google.com and also when i reboot all connectivity to xp is lost.
I can gain a connection again by following the steps at the start of the post so no biggie, but I would love to know whats going on with my xp box connecting via ip only.
I can post all settings if needed.
Once again any help would be greatly appreciated.
Alex.
anaoum
June 1st, 2006, 01:34 AM
on the windows box check that the dns server is set to the ip of the ubuntu box
RavenOfOdin
June 1st, 2006, 01:39 AM
Or. . .
You can just use a router and save yourself one heck of a mess. :p
anaoum
June 1st, 2006, 01:42 AM
Yes, a router is very conveniant. BUT using a pc as a router allows you to do much more things......
calande
June 3rd, 2006, 03:31 PM
Doesn't work at all :(
charles@ubuntu:~$ ifconfig eth0
eth0 Encapsulamento do Link: Ethernet Endereço de HW 00:13:D4:02:E1:04
inet end.: 192.168.0.1 Bcast:192.168.0.255 Masc:255.255.255.0
endereço inet6: fe80::213:d4ff:fe02:e104/64 Escopo:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Métrica:1
RX packets:757 errors:0 dropped:0 overruns:0 frame:0
TX packets:759 errors:0 dropped:0 overruns:0 carrier:0
colisões:0 txqueuelen:1000
RX bytes:491663 (480.1 KiB) TX bytes:119066 (116.2 KiB)
IRQ:185
charles@ubuntu:~$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables v1.3.3: can't initialize iptables table `nat': Permission denied (you m ust be root)
Perhaps iptables or your kernel needs to be upgraded.
charles@ubuntu:~$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Password:
charles@ubuntu:~$ sudo echo 1 > /proc/sys/net/ipv4/ip_forward
bash: /proc/sys/net/ipv4/ip_forward: Permissão negada
charles@ubuntu:~$ echo 1 > /proc/sys/net/ipv4/ip_forward
bash: /proc/sys/net/ipv4/ip_forward: Permissão negada
charles@ubuntu:~$ chmod 777 /proc/sys/net/ipv4/ip_forward
chmod: mudando permissões de `/proc/sys/net/ipv4/ip_forward': Operação não permi tida
charles@ubuntu:~$ sudo chmod 777 /proc/sys/net/ipv4/ip_forward
charles@ubuntu:~$ echo 1 > /proc/sys/net/ipv4/ip_forward
bash: echo: write error: Operação não permitida
charles@ubuntu:~$ cd /proc/sys/net/ipv4/ip_forward
bash: cd: /proc/sys/net/ipv4/ip_forward: Não é um diretório
charles@ubuntu:~$ cd /proc/sys/net/ipv4/
charles@ubuntu:/proc/sys/net/ipv4$ ls -l
total 0
dr-xr-xr-x 7 root root 0 2006-06-03 16:22 conf
-rw-r--r-- 1 root root 0 2006-06-03 16:22 icmp_echo_ignore_all
-rw-r--r-- 1 root root 0 2006-06-03 16:22 icmp_echo_ignore_broadcasts
-rw-r--r-- 1 root root 0 2006-06-03 16:22 icmp_errors_use_inbound_ifaddr
-rw-r--r-- 1 root root 0 2006-06-03 16:22 icmp_ignore_bogus_error_responses
-rw-r--r-- 1 root root 0 2006-06-03 16:22 icmp_ratelimit
-rw-r--r-- 1 root root 0 2006-06-03 16:22 icmp_ratemask
-rw-r--r-- 1 root root 0 2006-06-03 16:22 igmp_max_memberships
-rw-r--r-- 1 root root 0 2006-06-03 16:22 igmp_max_msf
-rw-r--r-- 1 root root 0 2006-06-03 16:22 inet_peer_gc_maxtime
-rw-r--r-- 1 root root 0 2006-06-03 16:22 inet_peer_gc_mintime
-rw-r--r-- 1 root root 0 2006-06-03 16:22 inet_peer_maxttl
-rw-r--r-- 1 root root 0 2006-06-03 16:22 inet_peer_minttl
-rw-r--r-- 1 root root 0 2006-06-03 16:22 inet_peer_threshold
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ip_autoconfig
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ip_conntrack_max
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ip_default_ttl
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ip_dynaddr
-rwxrwxrwx 1 root root 0 2006-06-03 16:22 ip_forward
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ipfrag_high_thresh
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ipfrag_low_thresh
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ipfrag_secret_interval
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ipfrag_time
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ip_local_port_range
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ip_nonlocal_bind
-rw-r--r-- 1 root root 0 2006-06-03 16:22 ip_no_pmtu_disc
dr-xr-xr-x 6 root root 0 2006-06-03 16:22 neigh
dr-xr-xr-x 2 root root 0 2006-06-03 16:22 netfilter
dr-xr-xr-x 2 root root 0 2006-06-03 16:22 route
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_abc
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_abort_on_overflow
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_adv_win_scale
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_app_win
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_congestion_control
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_dsack
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_ecn
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_fack
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_fin_timeout
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_frto
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_keepalive_intvl
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_keepalive_probes
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_keepalive_time
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_low_latency
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_max_orphans
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_max_syn_backlog
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_max_tw_buckets
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_mem
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_moderate_rcvbuf
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_no_metrics_save
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_orphan_retries
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_reordering
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_retrans_collapse
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_retries1
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_retries2
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_rfc1337
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_rmem
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_sack
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_stdurg
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_synack_retries
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_syncookies
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_syn_retries
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_timestamps
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_tso_win_divisor
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_tw_recycle
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_tw_reuse
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_window_scaling
-rw-r--r-- 1 root root 0 2006-06-03 16:22 tcp_wmem
charles@ubuntu:/proc/sys/net/ipv4$ cat ip_forward
0
charles@ubuntu:/proc/sys/net/ipv4$ sudo nano ip_forward
charles@ubuntu:/proc/sys/net/ipv4$ sudo nano ip_forward
charles@ubuntu:/proc/sys/net/ipv4$ sudo apt-get install dnsmasq ipmasq
Lendo Lista de Pacotes... Pronto
Construindo Árvore de Dependências... Pronto
Pacotes sugeridos :
resolvconf midentd oidentd mc bridge-utils
Os NOVOS pacotes a seguir serão instalados:
dnsmasq ipmasq
0 pacotes atualizados, 2 pacotes novos instalados, 0 a serem removidos e 155 não atualizados.
É preciso fazer o download de 227kB de arquivos.
Depois de desempacotamento, 1118kB adicionais de espaço em disco serão usados.
AVISO : Os pacotes a seguir não podem ser autenticados !
ipmasq dnsmasq
Instalar estes pacotes sem verificação [s/N] ? s
Err http://br.archive.ubuntu.com dapper/universe ipmasq 4.0.6
404 Not Found
Obtendo:1 http://br.archive.ubuntu.com dapper/universe dnsmasq 2.25-1 [150kB]
Baixados 150kB em 20s (7453B/s)
Falha ao baixar http://br.archive.ubuntu.com/ubuntu/pool/universe/i/ipmasq/ipmas q_4.0.6_all.deb 404 Not Found
E: Impossível pegar alguns arquivos, talvez rodar apt-get update ou tentar com - -fix-missing?
charles@ubuntu:/proc/sys/net/ipv4$ sudo apt-get install dnsmasq ipmasq
Lendo Lista de Pacotes... Pronto
Construindo Árvore de Dependências... Pronto
Pacotes sugeridos :
resolvconf midentd oidentd mc bridge-utils
Os NOVOS pacotes a seguir serão instalados:
dnsmasq ipmasq
0 pacotes atualizados, 2 pacotes novos instalados, 0 a serem removidos e 155 não atualizados.
É preciso fazer o download de 76,7kB/227kB de arquivos.
Depois de desempacotamento, 1118kB adicionais de espaço em disco serão usados.
AVISO : Os pacotes a seguir não podem ser autenticados !
ipmasq dnsmasq
Instalar estes pacotes sem verificação [s/N] ? s
Err http://br.archive.ubuntu.com dapper/universe ipmasq 4.0.6
404 Not Found
Falha ao baixar http://br.archive.ubuntu.com/ubuntu/pool/universe/i/ipmasq/ipmas q_4.0.6_all.deb 404 Not Found
E: Impossível pegar alguns arquivos, talvez rodar apt-get update ou tentar com - -fix-missing?
charles@ubuntu:/proc/sys/net/ipv4$ /etc/init.d/dnsmasq restart
bash: /etc/init.d/dnsmasq: Arquivo ou diretório não encontrado
charles@ubuntu:/proc/sys/net/ipv4$ sudo gedit /etc/apt/sources.list
charles@ubuntu:/proc/sys/net/ipv4$ sudo apt-get install dnsmasq ipmasq
Lendo Lista de Pacotes... Pronto
Construindo Árvore de Dependências... Pronto
E: Impossível achar pacote dnsmasq
charles@ubuntu:/proc/sys/net/ipv4$ sudo apt-get install dnsmasq ipmasq
Lendo Lista de Pacotes... Pronto
Construindo Árvore de Dependências... Pronto
E: Impossível achar pacote dnsmasq
charles@ubuntu:/proc/sys/net/ipv4$ sudo apt-get install dnsmasq ipmasq
Lendo Lista de Pacotes... Pronto
Construindo Árvore de Dependências... Pronto
E: Impossível achar pacote dnsmasq
charles@ubuntu:/proc/sys/net/ipv4$ dpkg-reconfigure ipmasq
/usr/sbin/dpkg-reconfigure deve ser rodado como root
charles@ubuntu:/proc/sys/net/ipv4$ sudo dpkg-reconfigure ipmasq
Pacote `ipmasq' não está instalado e não há informações disponíveis.
Use dpkg --info (= dpkg-deb --info) para examinar arquivos do pacote,
e dpkg --contents (= dpkg-deb --contents) para listar seu conteúdo.
/usr/sbin/dpkg-reconfigure: ipmasq não está instalado
charles@ubuntu:/proc/sys/net/ipv4$
anaoum
June 3rd, 2006, 07:53 PM
Do not execute commands using sudo!
First change to root user by using "sudo -s- H" then execute the commands.
calande
June 3rd, 2006, 08:33 PM
Thank you, actually after updating here it worked fine. Why can't I use sudo? Is it unsecure? :rolleyes:
Gobboman
June 4th, 2006, 03:15 PM
I followed the guide and it worked perfectly. I had a similar problem as one of the other guys on here. None of the changes stick. I have to run all those commands every time after I reboot.
oh.. and is net.ipv4.ip_forward = 1 the same as the commented out line in the sysctl.conf file net/ipv4/ip_forward=1 ?
](*,)
Nyala
June 17th, 2006, 09:25 PM
Has anyone tried this with a wireless card for the local network? My wireless router died, so I'm trying to set up my Ubuntu PC in its place:
cable modem --> (eth0 lan card) Ubuntu PC (eth1 wifi card) --> several wifi computers on the local net
Seems like it would be fairly common to want to use a linux box as a wireless router, but I can't seem to find any helpful information. As soon as I set wifi eth1 to a static IP address, my Ubuntu box can no longer surf the Net.
I'm also not sure if setting an ESID and password in the networking control panel, which is usually used when ubuntu is a client of a wifi network, will work when it's acting as the wifi router.
Thanks for any info or helpful pointers you can provide.
-Dustin-
donotspamme
June 21st, 2006, 05:08 PM
Hi folks!
Could someone please help me with this one:
I have used my linux box (with mandrake) as a proxy server for quite a some time, but I got fed up with mandarin's log filling problem I couldn't fix.
Now I'm trying to get the network shared with breezy. The setup is following:
ADSL modem-->(DHCP,eth0)_ubuntu computer_(192.168.0.1,eth1)-->scwitch-->
(192.168.0.x)several computers (with static ips)
The problem is: IT IS NOT WORKING GODDAMMIT!!! ](*,) I have tried everything mentioned on this thread as well in other similar threads, It has took me sweat, time and blood, but still nothing. I'd like to know what could be wrong. all the computers are able to ping each other, but the inner computers simply can't reach the internet. I'm getting a little frustrated here... :confused:
please help me, I need to get this to work... many angry people are standing behind me and waiting... :(
BrowneR
June 29th, 2006, 06:40 PM
Great HOW-TO! Thankfully after much messing around and about an hour of tweaking i have it working for me.
My question however is why!? i would love to understand the dynamics of how it all works under the hood.
from what I can gather...
1) we have added a rule to iptables which forwards packets from one subnet (eth1) to the internet (eth0) - acting as a NAT
2) dnsmasq listens for dns lookups on the ubuntu router pc and forwards them to my isp's dns servers - ie. acting as the gateway
3) ipmasq does something to do with translating ip's between the two interfaces...? however i cant really see why this is needed if packets are already being forwarded by an iptables rule?
If anyone can clear this up for me that would be great :)
TIA
Chris
BrowneR
June 29th, 2006, 06:46 PM
also as a second thought could something similar not be acheived by simply bridging the two interfaces (apparently this is easy with the bridge-utils package?) as long as you are either using static ip's or running a dhcp server as well.
mchojrin
July 30th, 2006, 04:54 PM
I'm trying to share my internet connection but when I use the command apt-get install dnsmasq ipmasq I get the message E: Couldn't find package dnsmasq
:(
tuga
August 6th, 2006, 04:59 AM
mchojrin,
You have to enable the repositories:
System->Administration->Synaptic->Settings->Repositories...
rrsarge
August 9th, 2006, 07:13 PM
Lost newbie -
I have a Ubuntu laptop w/ wireless to internet (eth1) and unused ethernet (eth0). Would like to plug IP phone into unused ethernet (eth0) and get to internet via wireless (eth1). I tried the instructions at the beginning of this post - seemed to have no problems executing commands in root term, but still no worky.
I found after following the instructions (and reboot) my unused ethernet (eth0) still had DHCP selected - shouldn't it have been assigned the ip I put in 'ifconfig eth0 ip'?
Also, eth0 shows no network connection, even though I've plugged it into a router and another PC via crossover.
Please help!
TheGamingPit
August 10th, 2006, 09:29 PM
Thank you very much...I have been trying to do this for over a week now. This one finally did it and the only difference I could find was that in yours you had net.ipv4.ip_forward = 1 instead of net/ipv4/ip_forward=1
I hope this helps others.
DeonaLyn
August 11th, 2006, 05:28 PM
Hi - this is the same set-up that we have here (except that we have Ubuntu 6.06 loaded on)... we are able to get the internet working with the 'how-to listed'.. finally after struggling with trying to do it on our own for a week, see post 1367460 (http://ubuntuforums.org/showthread.php?p=1367460)](*,) ; but having to use the dynamic IP set on the windows XP boxes. The dynamic IPs is a better option because we have LAN parties where folks bring their PCs and hook up to our system and the Linux machine should be handing out IPs for them, rather than us having to manually configure all the machines every time. Has anyone got a fix for why the DHCP portion of this code isn't working? We are pppoe dependent and don't have a static IP from our ISP. I am a real newbie to Linux, but my techie employees convinced me that Linux & Ubuntu is the way to go!! Reading the forums, the help guides and the literature I agree - but there is quite a learning curve :)
Also, each time we load firestarter to add in the firewall protection, the whole system crashes, so will be trying the direct format, rather than the gui - unless someone has a better suggestion based on our structure...
As a side note - I am really impressed by the support and community that the Ubuntu community shows. It beats the heck out of what I have seen in the 'other' community! :D
Deanna
Hello everyone!
I got the iBurst up and running, with the pppoeconf command :)
So, I setup Linux as a PDC, DHCP, caching DNS server, and want it to route internet traffic for the LAN
My setup is as follows:
iBurst Modem (pppoe connection - get's IP from ISP - 196.2.108.xxx)
|
|
|
eth0 (192.168.0.2)
||
Linux box
||
eth2 (192.168.10.1 - running DHCP)
|
|
|
24 port hub
| | | | |
XP PC 1 XP PC 2 XP PC 3 etc etc
The XP PC's can ping 192.168.10.1 & 192.168.0.1, but not 196.2.108.xxx, nor for example google.com. I tried running
"iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE", but that doesn't seem todo anyting. In fact, I followed the Howto Share internet connection
Can somone please assit me with this?
dagothempirius
August 24th, 2006, 05:07 AM
Is this still functioning under dapper? Because I can't download firestarter, I want to share my internet connection to my lan.
anaoum
August 24th, 2006, 05:08 AM
$ sudo apt-get install firestarter
dagothempirius
August 24th, 2006, 05:18 AM
Is this still functioning under dapper? Because I can't download firestarter, I want to share my internet connection to my lan.
Already did that, am I missing something?
.Danny
August 31st, 2006, 03:05 AM
Thanks for the great guide. It worked without problems. However I'm left with 1 problem that doesn't seem to work. I can ping all websites fine, and they work in my browser. However as soon as I try to open a https website it doesn't work.
Any idea why?
BrowneR
August 31st, 2006, 06:50 AM
if there is no problem surfing to standard http sites then i dont think the problem is related to the nat you have just setup on your router.
you will want to make sure there are no restrictions in place on port 443 on any firewalls you are using (dont see why there would be though).
failing that more likely there is a problem with the browser you are using. make sure it is setup to use TLS and SSL (usually in the browsers options). what browser are you using? you could possibly try with another and see if that sorts things out.
you may also like to try directly connecting the effected pc to the internet (without the router) and see if that fixes your problems at least that way we can possibly rule it out.
.Danny
August 31st, 2006, 03:21 PM
When it's connected to the internet directly all pages work fine. I tried with both Safari and Firefox. I can also view all pages fine when browsing via Firefox in Ubuntu, it's just that when I go through Ubuntu then I don't see https pages.
Anyway I'm getting a router tomorrow so I'm not gonna have to route it through Ubuntu and it should work fine then.
happosai
September 2nd, 2006, 11:42 AM
I'm not of expert of linux, but I had the same problem.
I solved it just installing shorewall (apt-get install shorewall) and configuring it with webmin.
So u can make an ubuntu box "router" with
-ip sharing (echo 1 > /proc/sys/net/ipv4/ip_forward);
-ip masquerading
-vpn tunneling
-firewall
I paste mu configuration files and I hope it would be helpfull
Shorewall configuration files are stored in /etc/shorewall.
#zones
fw firewall
net ipv4
loc ipv4
#masq (i have an ADSL modem)
ppp0 eth0
#interfaces
net ppp0 detect
loc eth0 detect
loc eth1 detect
#policy
loc net ACCEPT
loc fw ACCEPT
fw loc ACCEPT
fw net ACCEPT
net all DROP info
all all REJECT info
#tunnels
gre loc
ipsec loc
#rules
ACCEPT net fw tcp 80,22,21,110,8080
ACCEPT net fw icmp
ACCEPT loc fw tcp 80,22,21,110,8080
ACCEPT loc fw icmp
Good luck!
Bye!
gils0040
September 3rd, 2006, 03:55 PM
im having problems with the dns. this is my setup
College network -->eth1 (131.212.146.145) | ubuntu dapper | eth0 (192.168.0.1) --> xbox
xbox
ip: 192.168.0.2
dns: 192.168.0.1
i can not access the internet from the xbox. the xbox live trouble shooter fails at dns check.
can anyone see anything wrong with what im doing?
also when doing dpkg-reconfigure ipmasq should PPP connections recomputer firewall? should ipmasq be started after network interfaces are brought up or after network services have been started?
any help is greatly appreciated
edit: for some reason ipmasq was not started, so i fired it up and problem solved. thanks for the help
BrowneR
September 4th, 2006, 05:38 AM
i presume you have the dnsmasq package installed and configured to provide dns forwarding and dhcp on eth0? i would check your dnsmasq.conf for errors or post it and i'll take a look.
Also check your ubuntu box has the correct dns servers in its /etc/resolv.conf for your college network.
Viskovitz
September 5th, 2006, 04:52 PM
OH MY GOD!
This little howto helped me connect my ipaq with familiar to the Internet, something I hadn't managed before with specific HOWTOs. Thanks a lot!!!
KuruOujou
September 10th, 2006, 04:07 PM
this is perhaps the most unreasonable, unreliable how to I have ever seen. I did it and now my ubuntu laptop is royally screwed. It cannot connect to the internet and my windows computer cannot connect to it. This thing screwed it up so bad I fear I may have to wipe and reinstall ubuntu in order to get internet running on my computer again. Thanks alot, dumba55, you just screwed up my whole life. F*CK YOU!
EDIT: Ok, a few years later, but I just remembered I made this post, and as my first post no doubt. I wanted to apologize to the author and all of the members of the forums who have read this, I was a real n00b. I haven't been on this forum for a while, idk why. It's a great forum. But yes, I was a stupid dumbass, not the person who wrote this great how to. I followed the same howto last week, not even noticing this post (I didn't travel this far back), and it worked perfectly. Sorry everyone.
BrowneR
September 11th, 2006, 08:07 AM
this is perhaps the most unreasonable, unreliable how to I have ever seen. I did it and now my ubuntu laptop is royally screwed. It cannot connect to the internet and my windows computer cannot connect to it. This thing screwed it up so bad I fear I may have to wipe and reinstall ubuntu in order to get internet running on my computer again. Thanks alot, dumba55, you just screwed up my whole life. F*CK YOU!
well simply undo the steps if it didn't work for you - no need to take it out on the poster - all how-to's are performed at your own risk and there is a level of risk involved with all of them. you should only attempt something if you are confident you can undo the damage.
personally i have used this how-to as a base setup for a couple of systems without problems - i believe most of the issues are with people misunderstanding the instructions or their own network topology.
Thanks alot, dumba55, you just screwed up my whole life. F*CK YOU! and that was totally uncalled for.
just do the following:
Change the line "net.ipv4.ip_forward = 1" in /etc/sysctl.conf to read "net.ipv4.ip_forward = 0"
then
echo 0 > /proc/sys/net/ipv4/ip_forward
then
iptables -t nat -D POSTROUTING -o ethX -j MASQUERADE remember to substitude ethX for your interface.
then
sudo aptitude purge dnsmasq ipmasq
now make sure your /etc/network/interfaces file reads correctly. if in doubt just set it up for dhcp by adding the following for each interface (ethX):
iface ethX inet dhcp
restart.
check your /etc/resolv.conf contains the correct DNS servers.
Kurdt
September 11th, 2006, 07:04 PM
Hi, i am sharing internet with this guide, gtalk, skype and browsing works on my mom's windows computer but live messenger won't any clues ?
fishfillet
September 11th, 2006, 09:42 PM
I would like to share my experience on sharing our internet connection with IPKUNGFU. Story is here: http://teqnix.blogspot.com/2006/06/ipkungfu-kicks-firestarter-out-of-my.html
To install ipkungfu:
sudo apt-get install ipkungfu
edit accordingly the portions below in your /etc/ipkungfu/ipkungfu.conf:
$ sudo gedit /etc/ipkungfu/ipkungfu.conf
portions to be edited...
# IP Range of your internal network. Use "127.0.0.1"
# for a standalone machine. Default is a reasonable
# guess.
LOCAL_NET="192.168.1.0/255.255.255.0"
# Set this to 0 for a standalone machine, or 1 for
# a gateway device to share an Internet connection.
# Default is 1.
GATEWAY=1
These changes specifies the IP and subnet mask of the LAN and if you want to make your PC a Gateway aka share internet connection.
On the client side, make sure you have the same ip range (192.168.0.X) and subnet mask as with the PC sharing the internet. Also, make sure that the gateway IP specified is the PC that is sharing the internet.. on the DNS or nameserver, i use OpenDNS (208.67.222.222 and 208.67.220.220). Remember, this is on the client side.
After that, edit /etc/defaults/ipkungfu and replace "IPKFSTART = 0" with "IPKFSTART=1".
Fireaway ipkungfu!
$ sudo ipkungfu
That's it :)
blkdragon
September 21st, 2006, 07:13 PM
i need to configure my pc so i can use it as a gateway.
my connection goes as follows:
modem-->PC (windows xp)-->Linux laptop
i've got two Ethernet ports on my pc, and one on my lappy.
using a crossover cable to connect the two computers, and a normal CAT5 to connect the PC and modem, how would i be able to go on the internet with both computers at the same time, and still be able to share files?
blkdragon
September 21st, 2006, 07:35 PM
soz for the double post, but problem solvered.
follow:
http://ubuntuforums.org/showthread.php?p=1528164
instructions to the letter, even if you dont have wireless,and it should work fine.
oh, and i didnt set the eth0 to DHCP.
i had to manually set static ip addy and gateway.
oh and windows xp automatically set up a network bridge, which seemed to help.
esaym
December 6th, 2006, 02:11 PM
what is the best way to get dhcp on both netcards?
BrowneR
December 6th, 2006, 03:34 PM
you need to be more specific.
do you want a dhcp server on both cards or a client on both cards or a mix!?
what set-up are you trying to achieve?
esaym
December 6th, 2006, 10:08 PM
Oh sorry. I was hoping it wouldn't be that complex :D
What I am thinking about doing is converting my web server in to a gateway with squid on it. So the wan netcard will be plugging into my router and the local network card with be running into a switch with a couple of computers on it. So for convenience I would like dhcp to automatically give out ip addresses on the local network side.
BrowneR
December 7th, 2006, 08:59 AM
alright that shouldnt be a problem. the only complication is getting the dhcp server to broadcast your domain name servers (dns) to the clients.
one option is to specify these explicitly in the dhcp server configuration however this means that if they ever change then you will need to manually update your config.
another option is to setup your router as a dns relay as well as a dhcp server. this way you can just publish your routers ip as the dns server and then it will forward requests on to the internet.
the second option is more robust but does require some extra packages.
i will talk you through that option below.
from now on i will refer to your local network card as ethLAN and your internet facing card (to your modem) as ethWAN. you will obviously need to substitute the correct numbers in.
lets setup your interfaces first and decide on a network subnet to use. assuming your modem is using 192.168.1.1/255.255.255.0 we will use something else to avoid problems. (192.168.2.1/255.255.255.0)
sudo nano /etc/network/interfaces
edit to read as follows...
auto ethLAN
iface ethLAN inet static
address 192.168.2.1
netmask 255.255.255.0
auto ethWAN
iface ethWAN inet dhcp
this sets your router ip to a fixed value of 1982.168.2.1 for the local network and connects to your modem via dhcp.
now your going to want to install the dhcp server package using apt.
sudo apt-get install dhcp3-server
now we have the code installed it just needs configuring. take a look at the following file in your favourite editor (eg nano)
sudo nano /etc/dhcp3/dhcpd.conf
there are plenty of comments in there to help you along with the configuration you need. for a simple configuration you could just add the following to the end of the file:
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.10 192.168.2.254;
option domain-name-servers 192.168.2.1;
option routers 192.168.2.1;
}
now we need to tell the server which interfaces to listen on:
sudo nano /etc/default/dhcp3-server
and add your interface ethLAN between the quotes so the line reads
INTERFACES="ethLAN"
now clients are expecting us to forward dns queries so we should set that up...
install the packages sudo apt-get install bind9
the default configuration should work fine for us so that is all we need to do.
now we just need to bring up the interfaces and start the dhcp server. (or a restart would do).
sudo ifdown -a && sudo ifup -a
sudo /etc/init.d/dhcp3-server restart
if you get errors when trying to start the dhcp server then go back and check you have configured it correctly and specified the correct interface.
let me know if you have any problems as ive just been doing this from memory and i may have overlooked something.
this setup does not involve squid at all - im afraid i have no experience with that.
maybe there is another thread on that.
i think you will want to add an iptables rule to forward web requests to your local squid port. something along the lines of...
iptables -t nat -A PREROUTING -i ethLAN -p tcp --dport 80 -j REDIRECT --to-port 3128...for a transparent setup :confused:
esaym
December 7th, 2006, 12:50 PM
You're the man!
Give me about a month and I will post back the results. The "router" that I am talking about is a WRT54GL wireless running in client mode and it is pulling internet from a relative's house next door. I might stick a wireless card in the server box and do away with the router all together. I just bought it and I hate to throw money around like that though.
As far as the squid config I have it running on a smoothwall box that I am no longer using. I plan on just copying the configs right over. I have been using squid for awhile and know it pretty well so there should be no problems :D
Vegettex
December 11th, 2006, 07:47 PM
Weird, I've tried it on a clean install of ubuntu 6.06 but it didn't work. Must have missed something.
This is what I eventually want:
modem -> ubuntu (eth0 nic to the world, eth1 to my home network) -> switch -> computers (preferd with dhcp)
Like I've said, I just did a clean install with 6.06, updated my apt and then started with the guide.
1. Start by configuring the network card that interfaces to the other computers on you network:
# ifconfig ethX ip
I did: ifconfig eth1 192.168.2.1
2. Then configure the NAT as follows:
# iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
I did: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
The other things are pretty straight forward (I chose the default values with the ipmasq reconfigure).
My /etc/network/interfaces contained:
auto eth0
iface eth0 inet dhcp
iface eth1 inet static
address 192.168.2.1
netmask 255.255.255.0
but now it doesn't work any more... I couldn't ping anything outside, so I commented the eth1 lines in the interfaces file, restarted my network but... no difference.
I hope somebody can lend me a hand over here :-)
Thanks in advance!
BrowneR
December 12th, 2006, 09:23 AM
Do you mean the Ubuntu box itself cannot access the internet or the other computers on your lan?
First you may want to check the interfaces are configured and up:
ifconfig
You also want to check that ip forwarding is on:
cat /proc/sys/net/ipv4/ip_forward
you should get a result of 1.
Then check your iptables rules are ok by running the following:
sudo iptables -t nat -L
you should only see the one rule which you added.
If you post the output's of these commands i will take a look.
Vegettex
December 12th, 2006, 01:42 PM
Sorry, my post wasn't clear enough, I cannot connect to the internet anymore from my server to the internet.
My ifconfig says:
eth0: addr 192.168.1.65, Bcast 192.168.1.255, Mask ,255.255.255.0
My /proc/..ip_forward gives indeed a '1'
And the iptables command gives me:
Chain PREROUTING(policy ACCEPT)
target prot opt source destination
Chain POSTROUTING(policy ACCEPT)
target prot opt source destination
Chain OUTPUT(policy ACCEPT)
target prot opt source destination
I hope you can get me a little further :)
Thanks :-D
BrowneR
December 12th, 2006, 05:12 PM
thats strange. you seem to be connected to your modem ok.
it may be a dns problem. that would mean that you could not ping www.google.com but could ping 66.249.85.99 (a google ip). you should also be able to ping your modem eg. 192.168.1.1
in which case you want to make sure that the correct dns servers are listed in your /etc/resolv.conf
however i would have thought these would be set by your modem via dhcp...
your iptables output shows that the rule you added is no longer there but that shouldn't effect your internet access at all.
i suppose it's possible you mistyped the iptables rule and added something else instead? unlikely though.
by default you shouldn't have any rules in any of the tables.
to be honest im not really sure. maybe someone else has some ideas?
mapalma
December 17th, 2006, 04:43 PM
Dont work :(
pc1: 192.168.0.1 255.255.255.0
pc2: 192.168.0.2
dns:
root@pchome-desktop:/home/pchome# cat /etc/resolv.conf
nameserver 200.42.97.110
nameserver 200.42.0.110
root@pchome-desktop:/home/pchome# sudo iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- 192.168.0.0/24 anywhere
MASQUERADE all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
albuemil
December 19th, 2006, 02:11 PM
EDIT : sorry for double post, pressed the submit button twice
albuemil
December 19th, 2006, 02:16 PM
Hy.
I've got a similar problem, i can't manage to make the Internet connection sharing work.
I did manage to get a "hack" so temporarily it does work, but it's not the best way.
OK, so first of all, here's my setup :
INet > PPPoe connection > ppp0 on eth1 > [Ubuntu Server] > eth0 -> switch -> XP1 and XP2
I tried this :
ifconfig eth0 192.168.1.1
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
/etc/init.d/dnsmasq restart
ifconfig eth0 192.168.1.1
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
but the /etc/init.d/dnsmasq restart line gives an error Restarting DNS forwarder and DHCP server: dnsmasqdnsmasq: failed to create listening socket: Address already in use
(failed to start).
The really strange thing is that without that line, if i stop and restart the PPPoe (poff -a followed by pon dsl-provider) then the internet connection is shared. But when i restart the server I have to do all this again.
For now, i modified /etc/rc.local file and added this lines# stop PPPoe connection
poff -a
# make the IP masquerade
ifconfig eth0 192.168.1.1
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
#/etc/init.d/dnsmasq restart
ifconfig eth0 192.168.1.1
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# restart the pppoe
pon dsl-provider
, but it's not what i wanted :???:
Also, I'd like to forward a port (for example 4130) to a certain IP address (ex : 192.168.1.10) but i didn't manage to do that neither :-(
Any help would be welcomed, since i don't want to change the server to any other distro, i like Ubuntu too much :-)
P.S. i tried understanding the iptables program, but don't exactly understand how to use it. Could i use the Webmin interface to configure this up, and if so how ?
Thanx in advance, and sorry for the long post.
djberndt
December 26th, 2006, 08:50 PM
hi!
someone else have asked the same question earlier in the thread but he got no answer, so I'm trying;
is it possible to share internet via the wireless network card, using this guide?
I'm wired to the internet, and I want to share my internet connection with my girlfriends laptop running XP. I've got an on board wireless network card (i945). I've also patched it for promiscous mode, if that is necessary..
thanks in advance.
/daniel
john_spiral
January 20th, 2007, 06:56 PM
Hi,
I've got one Ubuntu machine on an USB ADSL Internet connection and another linux box (Damm Small Linux) on a ethernet connection.
The other linux machine (DSL) is attempting to connect to the Internet through eth0 on the Ubuntu box.
Followed the howto but my DSL box doesn't get an ip address from the Ubuntu box?
My only deviation from the howto was on line 2:
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
any ideas?
john_spiral
January 21st, 2007, 06:32 AM
I've got it working! Thanks for the howto.
Just needed to use the DSLpanel > Netcardconfig tool to assign a static ip address of 192.168.0.2 to the DSL box with the ubuntu box as the gateway.
voila!
BigIslandVegan
January 22nd, 2007, 05:00 AM
How might one share the internet connection that I have through a USB-Bluetooth adapter with my EDGE (T-Mobile) phone with another computer connected via ethernet, through a router?
Thanks so much in advance for the help.
john_spiral
January 22nd, 2007, 05:09 AM
How might one share the internet connection that I have through a USB-Bluetooth adapter with my EDGE (T-Mobile) phone with another computer connected via ethernet, through a router?
Thanks so much in advance for the help.
Hi BigIslandVegan,
run a ifconfig on the machine with the 'USB-Bluetooth adapter with my EDGE (T-Mobile) phone'
post your results.
what OS is the other machine using?
BigIslandVegan
January 23rd, 2007, 08:32 PM
Thanks for the response. Here is what I got:
*******@ubuntu:~$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:42674 errors:0 dropped:0 overruns:0 frame:0
TX packets:42674 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7181613 (6.8 MiB) TX bytes:7181613 (6.8 MiB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:72.250.2.86 P-t-P:192.200.1.21 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:21014 errors:0 dropped:0 overruns:0 frame:0
TX packets:18992 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:19615382 (18.7 MiB) TX bytes:2067134 (1.9 MiB)
BigIslandVegan
January 23rd, 2007, 08:38 PM
Most likely the OS of the other computer will be Ubuntu / Xubuntu as well.
I gotta figure out what will work best. The other machine is in flux a little bit right now. We have only an old machine with 64 mb or ram but we may receive a better machine this weekend from a friend that doesn't want it. Regardless, the next machine will also have a Linux OS.
Thanks again!
Abhi Kalyan
January 25th, 2007, 06:40 PM
Worked like a charm
Thank you Bro
bullit
January 28th, 2007, 12:10 PM
Hi
I've read the stuff discussed here. Tried the solution. It seemed to work, only on one end.
Here's the story.
I've using an ubuntu box and I want to set it up as a gateway/proxy for our home network; a wireless connection with an XP box.
I've tried the solution on the 1st page. It seemed to work because XP detects the wireless network connection but isn't able to get onto the internet.
My setup is like this:
Ubuntu > wireless router (connected by a cable because it's right next my machine) > wirelessly to XP.
I've been tearing my hair over the past 7 hours (according to my wife) over this thing.
The default gateway and preferred DNS have been set to 192.168.0.1. If I get this correctly, do I even have to change the IP and port on the browsers to get connected?
I would love to get some your opinion on this.
Thanks in advance.
john_spiral
January 28th, 2007, 06:56 PM
Thanks for the response. Here is what I got:
*******@ubuntu:~$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:42674 errors:0 dropped:0 overruns:0 frame:0
TX packets:42674 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7181613 (6.8 MiB) TX bytes:7181613 (6.8 MiB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:72.250.2.86 P-t-P:192.200.1.21 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:21014 errors:0 dropped:0 overruns:0 frame:0
TX packets:18992 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:19615382 (18.7 MiB) TX bytes:2067134 (1.9 MiB)
Hi BigIslandVegan,
Looks like your eth0 (ethernet) port has not been activated.
Activated through the GUI.
Then give it an exciting address like 192.168.0.1
Follow the howto.
start off with:
sudo su
to give you root access
change setp 2 to:
iptables -t nat -A POSTROUTING -o
ppp0 -j MASQUERADE
Give the other system an ip address of 192.168.0.2 and set it's gateway as 192.168.0.1
give it a try
Johne
lonetree
January 29th, 2007, 10:37 AM
Could someone write an working example for this?
john_spiral
January 29th, 2007, 06:57 PM
Hi
I've read the stuff discussed here. Tried the solution. It seemed to work, only on one end.
Here's the story.
I've using an ubuntu box and I want to set it up as a gateway/proxy for our home network; a wireless connection with an XP box.
I've tried the solution on the 1st page. It seemed to work because XP detects the wireless network connection but isn't able to get onto the internet.
My setup is like this:
Ubuntu > wireless router (connected by a cable because it's right next my machine) > wirelessly to XP.
I've been tearing my hair over the past 7 hours (according to my wife) over this thing.
The default gateway and preferred DNS have been set to 192.168.0.1. If I get this correctly, do I even have to change the IP and port on the browsers to get connected?
I would love to get some your opinion on this.
Thanks in advance.
can both machines ping each other?
uboltun
February 12th, 2007, 01:06 AM
I have seen people installing both dnsmasq and dhcp3-server. Isn't dnsmasq has the DHCP server already ? Or there is a hidden reason behind this...
I was able to run internet with DHCP by changing /etc/dnsmasq.conf
I think uncommenting the line :
dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h
would work just fine.
computerjunkie
February 12th, 2007, 07:11 PM
Hey Sorry to butt in on this thread but I was wondering if anyone had any ideas of how I could network my PS3 through my ubuntu laptop so I can play my games online and get the updates for the ps3 (I want to do this because right now my college does not allow us to hook up a ps3 to the network in the dorms)
I do not want my computer to be used permanently as a server for the ps3 or even every day. and when I'm not using my console I do not want my computer to have to the ability to share its internet connection.
My question: is there an easier way to do this so I can turn it on and off when I choose?
Frenzy-br
March 16th, 2007, 09:04 PM
now how would i go about doing that with one network card???
Melophobic
March 21st, 2007, 04:39 PM
Works great for me!
Nice and simple how to, Thanks.
alexgieg
March 21st, 2007, 08:58 PM
My cable modem is connected to my Ubuntu box in eth1. Another network card, eth0 (static address: 192.168.0.1), connects to a Windows XP machine (static address: 192.168.0.2). I've followed many of the suggestions offered in this thread, but so far the XP machine cannot connect well to the Internet. I can ping Internet IP addresses directly with it (and both computers ping each other, of course), but whenever I try to access a server by name, it doesn't work.
And by "not work" I mean: at all. I can set the XP to use the DNS of my Ubuntu machine (192.168.0.1), the 2 DNS addresses from my ISP (200.162.196.29 and 200.162.192.29), the 2 DNS addresses from OpenDNS (208.67.222.222 and 208.67.220.220), but no matter which one I set, it seems to simply not access server names. And doing a manual "nslookup google.com" in Command Prompt gives timeouts.
So, what I think is that the Ubuntu box is for some reason blocking access to DNS servers. I've tried changing Firestarter's policies a little by explicitly allowing connections coming from the 192.168.0.2 machine and by explicitly permitting DNS (port 53) accesses both from the LAN and that machine, but nothing helped either.
So, I'm completely lost here. How do I make Ubuntu, or iptables, or the Firestarter firewall, or whatever, allow DNS queries coming from the LAN connected to eth0, or at least from the 192.168.0.2 machine? I think once I have this working the remaining will be easy...
uboltun
April 4th, 2007, 08:39 PM
I have a similar setup on my box. I am connected to the internet on eth1 through USB cable modem and eth0, wlan0 goes to either wireless or ethernet connection of WinXp computer. It has been a while , but I think all you got to do is this:
1 install dnsmasq , ipmasq , sudo apt-get install dnsmasq ipmasq
2. then run sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
3 Set eth0 to 192.168.0.1 ( sudo ifconfig eth0 192.168.0.1)
4 Edit /etc/dnsmasq.conf and find the line
#dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h
uncomment it
5 Reboot
On WinXp you can just set DHCP connection and it worked for me.
Good luck
sfine
April 16th, 2007, 06:28 AM
Well first, thanks for all the replies on any kind of problems here :P
So to my situation
cable modem -> switch -> ubuntu (cable modem knows my mac and gives me the ip via dhcp)
_________________________-> winxp (it gets nothing i have only 1 ip i can get from the modem)
so i need the winxp get http access thats all well and i rly dont wanna buy anything :)
and i cant touch the settings in the cable modem
stnever
April 16th, 2007, 09:07 PM
@alexgeig
I'm no expert, but I'm beggining to understand a few things. I'm assuming your Ubuntu box has no problems surfing the Internet.
Are you running dnsmasq in the ubuntu box as instructed in the howto? Can your XP box ping the DNS servers as well? You can try "forcing" a certain DNS by typing (in an XP command prompt):
nslookup www.google.com 200.184.26.3
This will force the machine to use the DNS server 200.184.26.3. If you get a normal response (for this case, 64.233.161.104 is one of Google's addresses), you can access the site directly:
http://64.233.161.104/
If you are still having problems, perhaps there really are some rules on the Ubuntu box preventing some traffic. But I don't know where would they be. Can anyone help us some more?
iceman504
April 17th, 2007, 03:42 AM
so how would i use this to connect my computer to my xbox so i can play online games on my xbox...My setup is two network cards (eth0: DSL modem to computer w/ ethernet cable and Eth1: my computer to my xbox with crossover cable. Im trying to play online with Xlink kai and playing on xbconnect and Xlink worked fine with windows if that helps.
I tried this once but i keep getting this error when issuing this command "/etc/init.d/dnsmasq restart " :
Restarting DNS forwarder and DHCP server: dnsmasqdnsmasq: failed to bind listening socket for 192.168.1.97: Address already in use
(failed to start).
all4spl
April 18th, 2007, 10:32 PM
here is my setup... modem >linux > out of linux to vista.... i got internet working on both of them... but the only thing is, how do i forward ports for vista???
Quinn5219
April 26th, 2007, 09:22 AM
Is it me?? Have I grown to accustomed to ease of opereation and hooking up to the Internet at the punch of a button. I finally got Ubunto 6.06 installed and to get instructions on how to install to the internet looks like special codes in making a nuclear reactor.
I really like the Ubuntu, but it took me 6 months to understand and figure out how to install it, when a few sentences would have shown me how to do this in a matter of minutes.
I have XP Media Center installed and installed my Ubuntu along with it. Works great, but, now to share a dial up ISP connection, I am lost. Later I will install DSL, but if it will not hook up to dial up, it will not hook up to DSL.
I have said it before, how can something so great as Linux Ubuntu yet be so incredibly hard to get things
done. Guess I should not have missed the last meeting. Any suggestions?
mvochin
April 28th, 2007, 06:51 AM
Hello! I have an ICS problem: I cannot use it in Win XP (by using their wizard I only get ftp acess from the client) and I also tried in Ubuntu the Firestarter, and the tutorial from this post's first page.
In windows, I can acces the internet on the client only by running a small proxy server program called CC Proxy or Proxyi (with static ip's) (but I'm limited by other applications proxy support).
Someone told me that the ICS does not work because my ISP verifies the TTL of the network packages, and it can determine those from the client.
Does anyone know a method to enable ICS in UBUNTU, or a similar proxy method?
Note: I have a wired internet connection (Lan with fixed ip and fixed MAC )
ebichu
May 12th, 2007, 03:09 PM
Hello, I'm trying to share Internet connection from my desktop computer to my laptop, I did exactly like the howto said, but my laptop still doesn't connect to the Internets. Please help. : )
bornakke
May 13th, 2007, 05:29 AM
Worked without a single problem!
Thanx dude!:guitar:
freduardo
May 17th, 2007, 09:43 PM
Hi,
Here's my problem:
It works! :)
Only not anymore after a reboot. :(
I have to run dpkg-reconfigure ipmasq (on the "server") every time after a reboot to get internet access on my other computers (the "clients"). After that it works again.
Is there some way to get past this?
I can't put dpkg-reconfigure ipmasq in a startup script, as it requires interaction (pressing enter).
Thanks in advance,
Freduardo
plech.d
May 24th, 2007, 10:03 AM
I've got the opposite problem.
I have a machine running winXP that shares an internet connection and I can't get my Ubuntu machine connected to it. I've set the static IP and subnet mask and I've set the gateway to the IP of my winXP machine and I've set the DNS servers to the ones that my winXP machine uses. I can connect to the network, but I can't connect to the internet using the winXP machine's connection.
spleecho
June 13th, 2007, 04:50 AM
ok i spent hours trying to do all this, my situation is a bit more complicated, i use evdo card as my internet, can you please tell me how to undo all these settings for the ethernet interface?
thanks
kromagg
June 29th, 2007, 06:29 AM
This post is so full of misinformation I just had to reply. Author please fix your post.
A list of problems:
First of, configure your network by editing /etc/network/interfaces (makes changes permanent) and ifup the interfaces.
Turning IP forwarding on is unnecessary and possibly insecure. DO NOT DO THIS.
The iptables line is completely unnecessary as ipmasq does this for you
dnsmasq is cool, however even a beginning user should take a look at /etc/dnsmasq.conf just to make sure it sort of does what he wants to. Just read through it from beginning to end, possibly set some variables.
If both your interfaces were up at the time you installed ipmasq there should be no problems. Rebooting is completely unnecessary. Possibly restart ipmasq (/etc/init.d/ipmasq restart) or reconfigure (dpkg-reconfigure ipmasq)
I'd also like to point out while dnsmasq combines dhcp and dns you might find other setups around the internet. Most notably, you could run bind for simple dns caching and dhcp3-server for dhcp. Do not run two dhcp or two dns servers at the same time or you'll get some weird problems.
Also whenever you install any software, go to /usr/share/doc/<packagename> and read the README.Debian, it usually includes a lot of useful information.
A last tip is that when you are debugging a problem, the following parts affect how your network work:
iptables configuration (iptables -L -t nat and iptables -L will list current rules)
configured ips (checkable with ifconfig)
configured routes, if any ("route" command)
And of course if you installed dnsmasq, the dnsmasq config.
Aessa
July 2nd, 2007, 04:55 PM
Thanks for pointing out this:
/etc/network/interfaces
I've dabbled there before with WPA...but never realised that ifconfig simply means to change that file. Would have saved me a few rants...I'm trying the standard server thing and after an hour of static IP setting hell (they just kept disappearing) I noticed avahi (shudder)...I then found enough info: avahi mentions IP addresses. OK, killed ahavi. No gain. OK, removed avahi, some gain. OK, completely remove avahi related libs...damn, lost KDE (using kubuntu). I almost lost it. Happily recovery went smooth with a simple apt-get install kubuntu-desktop, and I somehow kept the static IPs. So, I'm still not sure what avahi is and why on earth everything depends so strongly on it (get a lot of script errors along the way in feisty now), but I suppose there is no need to slaughter it like I tried to.
Quick question then: With all this ip forwarding, would you get the same effect with shorewall set up to manage traffic in the same manner? I'm trying to use all the Webmin related software so that other users can configure what they need to easily (our company is all of 6 people :) ).
Later on, what trouble can I then expect with Squid? With the current server (a mess) only http traffic works, and I think Squid blocks ftp (or there is yet another firewall I have to discover and turn off - we are behind several hardware firewalls of simple routers).
Alsvartr
July 5th, 2007, 10:38 AM
Hi. I have a desktop computer with Ubuntu 7.04 and vpn connection on it and I have a notebook with Win XP. I followed this instruction to share Ubuntu internet connection, but after installing dnsmasq and ipmasq I have lost internet vpn connection - it doesn't work nor at Ubuntu nor at Windows. BUT. The local network of my provider is work correctly on a both computers. Any suggestions?
AlFigue
July 5th, 2007, 04:25 PM
Thank you very much.
It was extremely useful your guide, i was fighting against windows for hours before a got here.
Thank you
Tim3L0rd
July 7th, 2007, 03:09 PM
Well here I am after trying to do this for the past 3 days. Read all 14 pages and sometimes it just makes it more confusing.
First off, I've done the steps listed on page one probably 10 times, and a few others, like firestarter and webmin but nothing has worked yet.
I have this linux box w/ubuntu, it has 5 nic cards on it. I've tested each cards connectivity individually and they all work. For my setup I'm only utilizing 2 cards, eth0 and eth1.
eth0 is connected to my router which is connected to the internet. eth1 is the interface I want to connet my XP laptop to.
UBUNTU BOX
eth0 Link encap:Ethernet HWaddr 00:01:02:68:61:DA
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
eth1 Link encap:Ethernet HWaddr 00:B0:D0:29:A8:2B
inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0
XP LAPTOP
IP 192.168.0.3
Subnet 255.255.255.0
GW 192.168.0.2
DNS 192.168.0.2
the gateway and nameserver for eth0 is 192.168.0.1 (router address)
the gateway for eth1 is 192.168.0.2 (address of eth0)
I'm not sure how to figure out the nameserver for eth1, I assume that the IP and/or name that's listed in the /etc/resolv.conf file is used on eth1 too.
Internet works fine on the ubuntu box (eth0) but nothing on the XP laptop. Pinging from ubuntu to XP doesn't really resolve anything, I mean, I get replies but I can unplug the ethernet cord and still get replies when I ping 192.168.0.3.
Is the addressing correct? What else am I missing? BTW, when I do this ...
# iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
I assign eth0 as the ethx. correct? Any help appreciated.
cbuhka
July 13th, 2007, 01:10 PM
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
can't initialize ip tables table 'nat' : Permission denied (you must be root)
How to become the root? In this topic http://ubuntuforums.org/showthread.php?t=327228 is written only about sudo. I've changed LINUS pass, like written there http://my.opera.com/Contrid/blog/show.dml/486617 but login root does'nt worl, " Administrator can't connect from this screen"
willyram
July 18th, 2007, 09:52 PM
Hi, I'm having exactly the same problem that freduardo talks about. Is there anything I should set up to solve it? I would like to have these definitions for Internet Connection Sharing permanent, as I am always connecting my Win XP laptop to the Kubuntu "server".
Tks in advance, Willy.
Hi,
Here's my problem:
It works! :)
Only not anymore after a reboot. :(
I have to run dpkg-reconfigure ipmasq (on the "server") every time after a reboot to get internet access on my other computers (the "clients"). After that it works again.
Is there some way to get past this?
I can't put dpkg-reconfigure ipmasq in a startup script, as it requires interaction (pressing enter).
Thanks in advance,
Freduardo
octaedro7
July 24th, 2007, 06:41 AM
UBUNTU BOX
eth0 Link encap:Ethernet HWaddr 00:01:02:68:61:DA
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
eth1 Link encap:Ethernet HWaddr 00:B0:D0:29:A8:2B
inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0
XP LAPTOP
IP 192.168.0.3
Subnet 255.255.255.0
GW 192.168.0.2
DNS 192.168.0.2
the gateway and nameserver for eth0 is 192.168.0.1 (router address)
the gateway for eth1 is 192.168.0.2 (address of eth0)
I'm not sure how to figure out the nameserver for eth1, I assume that the IP and/or name that's listed in the /etc/resolv.conf file is used on eth1 too.
Internet works fine on the ubuntu box (eth0) but nothing on the XP laptop. Pinging from ubuntu to XP doesn't really resolve anything, I mean, I get replies but I can unplug the ethernet cord and still get replies when I ping 192.168.0.3.
I'm not an expert at all but aren't you repeating IP's on your eth1 and xp?, so that's why you get replies even unpluging XP
octaedro7
July 24th, 2007, 09:29 AM
anaoum: I've followed your post to connect 2 ubuntu boxes, one with wireless connection to internet. I could only managed to reach this :
Note: Type all the following commands in a root terminal, DO NOT use sudo.
1. Start by configuring the network card that interfaces to the other computers on you network:
# ifconfig ethX ip
where ethX is the network card and ip is your desired server ip address (Usually 192.168.0.1 is used)
2. Then configure the NAT as follows:
# iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
where ethX is the network card that the Internet is coming from
# echo 1 > /proc/sys/net/ipv4/ip_forward
At this point I lost internet connection. Tried disconnecting and reconnecting but nothing. My wireless card is in roaming mode and I cannot change it even if I'm root .
Can you please tell me how to leave every thing as it was (default).
dannyboy79
July 24th, 2007, 04:18 PM
anaoum: I've followed your post to connect 2 ubuntu boxes, one with wireless connection to internet. I could only managed to reach this :
Note: Type all the following commands in a root terminal, DO NOT use sudo.
1. Start by configuring the network card that interfaces to the other computers on you network:
# ifconfig ethX ip
where ethX is the network card and ip is your desired server ip address (Usually 192.168.0.1 is used)
2. Then configure the NAT as follows:
# iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
where ethX is the network card that the Internet is coming from
# echo 1 > /proc/sys/net/ipv4/ip_forward
At this point I lost internet connection. Tried disconnecting and reconnecting but nothing. My wireless card is in roaming mode and I cannot change it even if I'm root .
Can you please tell me how to leave every thing as it was (default).
well you can clear all iptables rules with this command:
sudo iptables -F
BUT this will also remove ALL your other firewall rules. So this will just remove the one that was added above:
sudo iptables -t nat -D POSTROUTING -o ethX -j MASQUERADE
then just make sure that your /etc/network/interfaces file has the basics for getting your internet to work.
you can edit that file by using the System, Admin, Networking dialog box, then just enter what you did in the begining to get this to work.
ashokcm
July 24th, 2007, 05:19 PM
I connect to the internet from my ubuntu machine using VPN. When I enable the masquerading, the vpn does not work anymore. The internet connection goes dead. Is there something special I need to do for VPN connections? My setup is as follows
Machine1:Connects to internet using VPN
Ubuntu
eth1: ethernet which connects to the network which grants internet connection.
ppp0: the vpn connection. has a dynamic IP
etho: the card that I use to connect to the windows xp box.
Machine2:
Windows XP
Somebody please help :(
dannyboy79
July 25th, 2007, 09:53 AM
and you're sure you used the correct ethX interface's within the masquerading command?
Also, I am not sure I understand, if ppp0 is the connection that is to the internet, than what is the eth1 for? I don't know how VPN ties into all this but you should have internet coming into Ubuntu on 1 interface, what you're doing is forwarding the internet from the ppp0 connection to the eth0 connection so that windows xp can use it also.
octaedro7
July 25th, 2007, 10:20 AM
dannyboy79:
do you know why my wireless connection is fixed in roaming mode?
(when I uncheck the roaming mode box the ok button becomes unavailable)
If I use your fix, will it also fix this issue?
BTW: many thaks for the info
dannyboy79
July 25th, 2007, 12:29 PM
i don't know why? all I am suggesting is to remove the iptables rule that you added (POSTROUTING -o ethX -j MASQUERADE)
Have you tried to unplug your wireless card, then rename your /etc/network/interfaces file to something like interfaces-test, then shutdown your machine, then plug in your wireless card, then restart your machine. the system should recreate the interfaces file, then if you still don't have internet, you need to check the Networking setup box within System, Admin, to see if everything is configured correctly. Good luck
ashokcm
July 26th, 2007, 02:52 AM
and you're sure you used the correct ethX interface's within the masquerading command?.
First I tried with eth0 and then I removed all the rules and tried again for ppp0. Apparently it does not work for either case. In both cases it kills my internet connection.
Also, I am not sure I understand, if ppp0 is the connection that is to the internet, than what is the eth1 for? I don't know how VPN ties into all this but you should have internet coming into Ubuntu on 1 interface, what you're doing is forwarding the internet from the ppp0 connection to the eth0 connection so that windows xp can use it also
my ifconfig looks like this.
ifconfig
eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: xxxx::xxx:xxxx:xxxx:acc5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10570 errors:4 dropped:0 overruns:0 frame:4
TX packets:15151 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1048951 (1.0 MiB) TX bytes:15775149 (15.0 MiB)
eth1 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
inet addr:192.168.xx.xx Bcast:192.168.xx.255 Mask:255.255.254.0
inet6 addr: xxxx:xxx:xxx:xx:xxx:xxxx:xxxx:xxxx/64 Scope:Global
inet6 addr: xxxx::xxx:xxxx:xxxx:xxxx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:41488852 errors:0 dropped:0 overruns:0 frame:0
TX packets:33453975 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1350269 (1.2 MiB) TX bytes:4176860955 (3.8 GiB)
Interrupt:19 Base address:0x8900
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2404008 errors:0 dropped:0 overruns:0 frame:0
TX packets:2404008 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1261015328 (1.1 GiB) TX bytes:1261015328 (1.1 GiB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:212.201.xx.xx P-t-P:192.168.x.41 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1486 Metric:1
RX packets:87989 errors:0 dropped:0 overruns:0 frame:0
TX packets:122699 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:30012516 (28.6 MiB) TX bytes:144681309 (137.9 MiB)
The IP of ppp0 is my external IP (i can connect to my comp using this IP even from outside the network)
The IP of eth1 is my internal IP in the network. And I dont mean my home network but the network of the university.
My setup is such that I am connected to the uni network through which I access the internet through VPN. I also have a home network using 2 computers. I am trying to share the internet between these 2 computers