[SOLVED] Yes, another ICS topic, but with a twist (I hope)

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help

[SOLVED] Yes, another ICS topic, but with a twist (I hope)

Postby ChinaJ on Wed Nov 28, 2012 8:32 am

OK, so I've found many topics about sharing an internet connection. Most of them generally have to do with the following:

1) "I have a wired internet connection and want to share it via wifi on my laptop."
2) "I have a wired internet connection and want to share it through a second NIC that is wired directly to my second computer/via cross-over cable."

I also know about the (outdated and filled with poor English and lacking in coherency/ease) Wiki over here: https://help.ubuntu.com/community/Internet/ConnectionSharing

My situation is a tad bit different, and I haven't been able to find an exact solution for me.

I'm using Mint 13 32-bit XFCE on one computer with two NICs. I want to share the internet connection (coming in via eth0) through the other NIC (eth1) and out through a wireless router. I have it set up as a wireless access point (turned of DHCP, etc.) and it works fine through WinXP. But the ICS wiki noted above isn't quite what I need, because it first (under the IP Tables section) has just ONE computer connected to the network (via, yet again, a crossover cable), while I want to be able to connect multiple devices wirelessly; second, the "Advanced" networking section has you installing dnsmasq, which (from one post I found) unless you uninstall dnsmasq-base, dnsmasq won't work. Unfortunately, this also uninstalls Network Manager, thereby messing up my internet connection and making it so I can't connect to install dnsmasq. Installing dnsmasq does nothing, and rather gives an error message... something about socket 53 being used already (sorry I don't have the exact wording, I'm on my other computer at home).

Before anyone asks, it's not as simple as plugging the wireless router into the wall. I'm in China, where they like to control the internet; at this university I'm teaching at, they require a login program under Windows (an 802.1x security login program) that, fortunately, I can just use Network Manager to connect with. However, trying to get a router to connect and STAY connected isn't possible. I've tried two different routers on the network here, and they always get logged off randomly after a few minutes and have to be logged back in through the router's setup page (annoying to say the least).

So, looking at the ICS wiki, can anyone suggest any changes that I would need to make in order to do the following:

ISP<<--->>eth0 Ubuntu Gateway eth1 <<--->> wireless router <<--->> multiple devices

Do I need the Ubuntu desktop to do DHCP? Or can I just get the router to do it with some other settings tweaks? Thanks!
Last edited by ChinaJ on Mon Dec 17, 2012 8:56 am, edited 1 time in total.
ChinaJ
Level 1
Level 1
 
Posts: 46
Joined: Thu Jun 21, 2012 2:15 am

Linux Mint is funded by ads and donations.
 

Re: Yes, another ICS topic, but with a twist (I hope)

Postby stratus_ss on Wed Nov 28, 2012 12:14 pm

If I were in your situation I would do something like squid.

In my actual setup I have the following

pfsense (with dns/dhcp off) ---> squid (which hosts dns/dhcp) ---> wireless router

basically squid handles all my internet requests and shovels them out to the pfsense box which does the firewall/routing. It has the added advantage of caching websites and dns querries for me.

I would actually do this in a vm bridging your two ethernet adapters appropiately. If you look into it and decide you would like to move forward with squid just let me know and I can help walk you through it
stratus_ss
Level 4
Level 4
 
Posts: 270
Joined: Fri May 25, 2012 5:22 pm

Re: Yes, another ICS topic, but with a twist (I hope)

Postby ChinaJ on Thu Nov 29, 2012 3:50 am

stratus_ss wrote:If I were in your situation I would do something like squid.

In my actual setup I have the following

pfsense (with dns/dhcp off) ---> squid (which hosts dns/dhcp) ---> wireless router

basically squid handles all my internet requests and shovels them out to the pfsense box which does the firewall/routing. It has the added advantage of caching websites and dns querries for me.

I would actually do this in a vm bridging your two ethernet adapters appropiately. If you look into it and decide you would like to move forward with squid just let me know and I can help walk you through it


Not heard of pfsense OR squid. Can you tell me a bit more about these?

And you mention doing a VM... is that a VM in WinXP of Linux, a VM in Linux of XP, or something else? I'm afraid to do a VM of Linux in XP, because the XP is a "ghost" version, it's in Chinese, and try as I might, I don't think I got all the viruses, malware, spyware, and other nasty stuff off of it. That's why I'm dual-booting with Linux.
ChinaJ
Level 1
Level 1
 
Posts: 46
Joined: Thu Jun 21, 2012 2:15 am

Re: Yes, another ICS topic, but with a twist (I hope)

Postby stratus_ss on Thu Nov 29, 2012 10:24 am

I could attempt to summarize squid but its easier to link you to wikipedia which has lots of good summarization

http://en.wikipedia.org/wiki/Squid_%28software%29

pf sense is a router specific version of bsd, and thats basically all it does. I would encourage you to look it up as well. It may not be applicable for you.

As for a vm what I meant was, I run squid in a vm (linux guest) on a linux host so that it is portable wherever I need it to be.

Unless I specify otherwise, I personally will always be refering to some sort of free software (bsd, linux etc)
stratus_ss
Level 4
Level 4
 
Posts: 270
Joined: Fri May 25, 2012 5:22 pm

Re: Yes, another ICS topic, but with a twist (I hope)

Postby ChinaJ on Mon Dec 17, 2012 8:55 am

Wow, so I finally got it figured out. Without having to use Squid (sorry, stratus :oops: ).

After reading through the Ubuntu wiki a few more times, here's what I did:

ISP<<-->>eth0<<-->>eth1<<-->>wifi router

1) Turned on "Shared to another computer" under the IPv4 of eth1 (when I tried turning it on eth0, I couldn't connect to the internet at all... strange).
2) Ran ifconfig -a. Copied down the IP address given to eth1.
3) Went into my router, set it up to do DHCP, gave it a static IP within the same range of eth1 (in this case, the address for the NIC ended with a 1, so I ended the static IP address with 85), set the ISP Gateway to eth1's IP address.
4) Made sure that dnsmasq-base was installed.
5) Ran the following from the Wiki:

Code: Select all
sudo iptables -t nat -A POSTROUTING -j MASQUERADE


6) And in the old DLINK router I'm using, I had to manually set a DNS server, so I just used one of Google's.

And that was it! Wow. The confusing part was why the "Shared to other computer" setting wasn't working right, and then what ISP Gateway my router should be using.

EDIT 3/4/2013: Changed some of the information above. When I had to do this again due to someone resetting my router, the original steps didn't work right. Not sure what happened or what I was thinking, but the above is correct... for now.
ChinaJ
Level 1
Level 1
 
Posts: 46
Joined: Thu Jun 21, 2012 2:15 am


Return to Other networking topics

Who is online

Users browsing this forum: No registered users and 6 guests