Jump to content

BT HomeHub? Routing? I don't have a clue


omcaree
 Share

Recommended Posts

Hey all,

 

Sorry in advance for the vagueness of this post, but I don't actually know what is wrong I just have a feeling that something isn't working as it should. the story goes like this...

 

I've had BT broadband for a while now, with one of those fancy home hub things which acts as a router. That was all fine, I had my linux router/server box connected to the home hub and then all my machines connected to my linux box. Ideally, however, I want my linux box connected straight to the internet, not connected behind the home hub. I've played around with the settings on the hub and discovered an option to "Assign the public IP address to a device" or something to that effect, now this is where the fun starts. I told the home hub to assign this address to my linux box, it then told me that i'd have to renew my IP address on my linux box (assigned by DHCP) in order to get the new details, so i did. A quick glance at ifconfig revieled that I did indeed have the external address, however nothing worked. Any attempt to ping anything just came back with "Network is unreachable". Now at this point I gave up because I couldn't be bothered to think up sollutions.

 

However, since giving up, I have done the same thing (assigning public IP) to a windows machine, renewed my IP, and it works. As a result of that, I made a note of all the details which windows had received, and checked them against what linux had received, everything was fine appart from the fact that there was no reference to the default gateway on the linux machine. Now that is obviously the sollution to the unreachable network. I have managed to solve the problem by adding the default gateway myself, but this was not as straight forward as i had hoped.

 

I attempted:

route -n add default gw aaa.bbb.ccc.ddd

 

but that just gave me:

SIOCADDRT: Network in unreachable

 

I guess this is because the public IP address of my home hub is completely different to the gateway address. so I tried the following:

route -n add -net aaa.bbb.ccc.ddd netmask 255.255.255.255 eth3
route -n add default gw aaa.bbb.ccc.ddd

 

And this seems to work, I can now access anything. However this approach has resulted in the loopback devide going missing from the routing table and I cant figure out how to add it again.

 

Also, why can my linux box not perform this operation for me? the default gateway must be broadcast correctly by DHCP because my windows machine receives it. Does linux just ignore it because it cant route to it directly? rather than attempting to route to it?

 

The set up i currently have performs the above operation whenever the machine is reset, the problem is, if my ISP decide to change my gateway I am not going to know about it, other than the fact I have lost my connection. I will have to hook up my windows box, find the new gateway, and change it manually.

 

Can anyone offer an explanation as to what exactly is going on? and if there is any way to fix it?

 

If you need any more information just let me know.

 

Cheers,

 

Owen Mc

Link to comment
Share on other sites

What ethernet card is it assigned to? eth0? eth1?, etc, etc? Check this, then look at the corresponding config file /etc/sysconfig/network-scripts/ifcfg-ethx where x is the number of the connection with DHCP to get the public IP.

 

The route command I normally use is:

 

route add default gw xxx.xxx.xxx.xxx

 

where the xxx's are the address of the gateway from your isp for your example here.

 

The other thing to check, is in case the gateway is being overridden by the previous one, so look in /etc/sysconfig/network file and see if it has a gateway entry. If it does, put a # before the gateway line, and save the file. Then it won't attempt to load this. Chances are it might be that it has both, and why you end up with the problem.

 

Don't forget, if you want all the machines to see the internet via your Linux machine, you need to enable IP routing, although I expect you already have this enabled if it was working before.

Link to comment
Share on other sites

That would do the trick but in general I think its easier if the router allows it to just use a DMZ for the linux machine ... and NAT in the router (this is the same as ianw suggests except your offloading the NAT to the router)

Your IP add will still be a RFC non routable add (192. ,172. or 10. ) but the NAT will take care of that so that if you type your EXTERNAL ip it will take you to the box...

 

You can even give yourself a domain name using dyndns.org or similar.

 

The advantage of this is if you play about with the linux box you don't prevent access to the internet from other boxes... and its easier to know where the problem is...

Link to comment
Share on other sites

Thanks for the replies.

 

Ianw,

The interface is eth3, and the ifcfg file is unchanged from the previous configuration:

# cat /etc/sysconfig/network-scripts/ifcfg-eth3
DEVICE=eth3
BOOTPROTO=dhcp

 

networking file is

# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=black-box.myftp.org

 

no mention of gateways.

The route command you use is the same as I attempted, however it does not work without first adding a route to the gateway. Is there no way for linux to pick up the gateway from DHCP?

 

Gowator,

I used to use DMZ on my previous internet set up, however, I can find no mention of DMZ on the BT Home Hub, The only mention of DMZ is on the "Assigned Public IP to a device" page. Here is what it says:

Assign the public IP address of a connection to a LAN device

 

This page allows you to assign the public IP address of your Internet Connection(s) to a specific device on your local network...

 

You might want to do this if:

 

* You encounter issues with some applications through the Network Address Translation engine of your BT Home Hub.

* This device is running server applications (web server, ...) and you want it to be accessible from the internet.

* This device has to be considered as the unique entry to your local network (DMZ).

 

If DMZ was an option then I would be using this.

 

Cheers,

 

Owen

Link to comment
Share on other sites

Yeah, the gateway should be assigned automatically to the router, but it seems it's not doing this. Which is somewhat strange.

 

Check the config on the router to see if there is an option about this, if not, I would suggest assigning the gateway address manually in /etc/sysconfig/network and:

 

GATEWAY=xxx.xxx.xxx.xxx

 

where xxx is the gateway from your isp. These don't change very often from what I believe.

 

Another alternative if that doesn't work, is to add the route command that you manually type to /etc/rc.local, then it'll be done automatically after the system has booted.

Link to comment
Share on other sites

I will check the router config and see if there are any options i can see, but from what i remember there aren't.

 

I have assigned the gateway manually in /ets/sysconfig/network but this doesn't work without the route commands.

 

I have added the commands to the end of rc.local and everything is working, lets just hope BT don't decide to change it!

 

Cheers for the input, if anyone has a miraculous sollution then let me know!

 

Owen Mc

Link to comment
Share on other sites

That's the only thing I can think of at the minute to workaround your problem. But glad it works in the rc.local. I had a funny feeling that the /etc/sysconfig/network file would only work for static assigned IP addresses than DHCP assigned ones pushed from the router to give you the public IP address.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...