How do I share my Ubuntu's Internet connection with a LAN (via hardware router)
Here's how I did it:
Equipment:
Ubuntu 11.04 Desktop on 1st Gen. eeePC
Linksys WRT120N Wireless N Router
Huawei E620 USB Broadband Modem
Ethernet cable
Hardware Setup:
Huawei plugged into eeePC
Ethernet cable plugged into Ethernet port
other end of Ethernet cable plugged into the
Internet
port of The Linksys
Ubuntu Setup:
- connect the Huawei to the Internet
- disconnect the wired connection (Auto Eth0) in network tray icon
- create new wired connection (Edit Connections... > Add, enter a name) and select
Shared To Other Computers
from IPv4 settings tab. - connect to this new wired connection
- note down the settings for this connection under
Connection Information
, and the DNS servers for the Huawei connection
Linksys Setup:
- connect a computer on the receiving side to the Linksys (wired or wireless)
- open a browser in this computer, navigate to Linksys (
192.168.1.1
is default, user and password should be both admin) - Change
Internet Connection Type
toStatic IP
- Under
Internet IP Address
I put the number that came after the eeePC's IP address for this connection (again, not the IP for the Huawei connection), this was just a guess as I'm pretty clueless about how this works. So, my Ubuntu machine had an IP of10.42.43.1
, and I gave the Linksys10.42.43.2
Subnet Mask
should be same as the eeePC,255.255.255.0
Default Gateway
should be the eeePC's IP address,10.42.43.1
in my case.DNS 1
(etc.) should be the same as thePrimary DNS
(etc.) used by the eeePC in the Huawei connection.- Click
Save Settings
.
And now all machines on my LAN can connect to the eeePC's Internet via the linksys router. All is well.