You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

But it doesn't lay out EXACTLY what I want. I've never been very good at setting up network stuff, so I decided to come here and ask before I do something stupid.

I have a Wifi connection through a primary router that is shared with other people. My notebook connects to the Internet through that connection.

I also have a phone and a tablet using that same connection.

Two problems:

1) I want to be able to share data among my notebook, phone and tablet without worrying about any eavesdropping.

2) I wish I could use Privoxy to filter my Web browsing on the tablet and phone (I already do it on the notebook).

Solution: another Wifi router I have lying around here.

This second Wifi router cannot connect to the primary, remote router over Wifi. It's just a very cheap and basic router, not a bridge or access point, it can only receive data through an Ethernet cable, and I don't want to connect the two routers with cable. So my notebook will have to do the bridging. That's ok because then I can leverage Privoxy running on it.

So I want to keep the notebook having access to the Internet through the primary, shared router, but from now on, sharing this connection with my secondary router through an Ethernet cable.

So the notebook will be receiving data through wlan0 and sharing it through the eth0 cable with the second router (on the router's WLAN port).

If that works, the phone and tablet will no longer use the external router, just the secondary one. No one else will be able to access this secondary router, so I will have more privacy when moving data among the three machines. And the notebook will filter all the phone and tablet's Web browsing through Privoxy.

The site I mentioned above proposes two solutions for that: "bridging" and "firewalling." It's not clear to me whether I need both or just "firewalling."

Moreover, suppose I need both. Let's see what it says about "bridging."

Quote:

To create a bridge between your network adapters, begin by taking both adapters offline with the ifdown command. In our example eth0/eth1 setup, run sudo ifdown eth0 and sudo ifdown eth1 from the command line.

Next, create the bridge with sudo brctl addbr bridge0. The addbr command creates a new "virtual" network adapter named bridge0. You then connect your real network adapters to the bridge with addif: sudo brctl addif bridge0 eth0 adds the first adapter, and sudo brctl addif bridge0 eth1 adds the second.

Once configured, you activate the bridge0 virtual adapter just as you would a normal, physical Ethernet card. You can assign it a static IP address with a command like sudo ifconfig bridge0 192.168.1.100 netmask 255.255.255.0, or tell it to retrieve its configuration via DHCP with sudo dhclient bridge0.

But then I will need DHCP on the external, Wifi connection, but I suspect I had better assign a static IP address to the eth0 connection. Right?

Moving on, if I want to filter my phone and tablet browsing with Privoxy, I guess I will need the second solution, with or without the first. Thats is not very clear to me either:

Quote:

First, you will need to bring both network adapters up and assign each a different IP address -- and, importantly, IP addresses that are on different subnets. For example, sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0 and sudo ifconfig eth1 192.168.2.100 netmask 255.255.255.0. Note that eth0's address is within the 192.168.1.x range, while eth1's is within 192.168.2.x. Maintain this separation when you add other devices to your network and you will keep things running smoothly.

But that assumes the second solution only, because the first one lumps eth0 and wlan0 together as bridge0. Or maybe I am all wrong about this.

In either case, 'ifconfig wlan0 192.168.1.100' sounds like something impossible to me because I can't choose my own wlan0 IP. The primary router does that, it dictates my IP number and the IP number of everyone else using it.

Finally, what happens when I run 'ifconfig eth0 192.168.2.100' then hit 192.168.2.100 on the browser? Will that open the secondary router admin/configuration page? That's what I need, I guess.

Sorry, I need this help because I always mix all these things up in my head.

No bridge? But I am using Lubuntu, and whenever I plug the ethernet cable in to the notebook, I lose my Wifi connection, even if the other end of the cable isn't connected to anything. Lubuntu switches over to the ethernet connection immediately. As soon as I disconnect the cable, Lubuntu searches and finds my hotspot and reconnects again. I need both connections active all the time, and the notebook has to share the connection with the router. How do I do that without the bridge?

And not using wlan, what does that mean? I need wlan to connect to the Internet.