how to set the default gateway (/etc/network/interfaces ?)
Rashkae
ubuntu at tigershaunt.com
Fri Mar 8 08:33:47 UTC 2013
On 03/08/2013 02:42 AM, Thufir Hawat wrote:
>
> Installation without WPS - Mac
> Step 1: Turn off your computer’s wireless connection (if applicable) and
> disconnect the Ethernet cable currently connect to your computer (if
> applicable).
> Step 2: Use both the included RJ-45 Ethernet cable and the USB cable to
> connect the
> WiFi adapter with your computer.
> Step 3: Set your computer with a static IP address.
>
> but I'm thinking that is actually incorrect. However, it may be necessary
> in order to configure the IOgear device to use a static IP. Since only
> one device can connect to the IOgear device, there's not going to be any
> collisions. Even though the manual says to use a static IP address,
> router2 is using DHCP and everything works fine. However, that's only
> *after* the IOgear device was configured.
That's exactly right. The Iogear is pre-configured with a static IP
address (and no DHCP server). To set it up, you need a computer with a
static IP address on the same subnet so the computer and connect to it.
Presumably, once connected to the IOGear, you can direct it to connect
to your wireless network (Router 1), and if necessary, change the
pre-configured static IP. (ideally, the same subnet as your router1,
but an address that does not conflict with router1 DHCP range.)
> As to gateways, isn't the gateway basically the IP address for whatever
> is upstream? The gateway for the computer is router2, the gateway for
> router2 is the IOgear device, and its gateway is router1.
>
No, a gateway is the IP address to send packets that are not destined on
the same subnet.
Example: typically, with 192.168.x.x, subnet is 255.255.255.0 (that's a
bitmask, in binary, 11111111.11111111.11111111.00000000)
When a computer is sending a packet on the network, it first compares
the destination ip to the subnet mask. If the bits that are masked by 1
are all the same, (in this example, 192.168.1.x) then it knows the
packet is meant for the local network. In the case of Ethernet, looks
up the ARP address and addresses the packet to the appropriate NIC. I'm
not sure about Wi-Fi mechanics, but the same idea. If, however, the
bitmask does not match (say you are trying to deliver a packet to
192.168.2.5), then the computer knows it can not deliver the packet
itself, and must send it to a gateway. (Either there's a gateway
defined for the 192.168.2 netmask, otherwise send it to the default
gateway.) Gateway is another name for router, and it is the router's
job to figure out the next appropriate destination for that packet. In
the case of Internet Sharing Devices, Network address translation is
also done.
So, router1 should have a default gateway that is supplied by ISP. Any
devices attached to the local network should have as gateway router1's
IP address. (LAN address, not Internet address.) As you noted, your
local network can be segregated into a second subnet, so computer
default gateway is router2's IP, router2's gateway is router1's IP etc.
As I stated before, a bridge is not a router. Bridges do not get to
decide the next destination for packets. All packets entering one end
of the bridge should go out the other end with no modification.
Therefore, a bridge is never anyone's gateway.
Theoretically, if you wanted to give the bridge Internet access (for
itself, not for devices networked through it,), you would have to give
it a gateway address (should be router1's IP.) In most circumstances,
you probably don't even want the bridge configuration to be accessible
to computers not directly attached to the same network, so it would
never even need a gateway.
Therefore, once you have configured the bridge to connect to your WIFI
network, the computer network configuration should be returned to normal.
Now here's the weird thing..... that you are even using a bridge.
Typically, a bridge is used for devices that can't do wireless
themselves... (the most common examples, game consoles, Blu-ray players,
etc.) For a computer, typically would just add a USB Wi-fi device;
there are several that are linux compatible and work out of the box with
Ubuntu. I'm also not sure why the bridge requires the USB cable
attached as well as the Ethernet cable. Either the USB is used to
supply power to the bridge, or the presense of USB cable puts it in some
kind of "Configruation Mode" rather than "Bridge Mode", and needs to be
removed afterwards for the bridge to operate normally.
More information about the ubuntu-users
mailing list