Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a Red Hat Linux pc set up, dual booting with 2003. Now, 2003 connects to internet over dsl no probs. Linux is another matter. I set it up as follows.
you see the problem?! my adsl router has a IP in a different subnet, and for some reason linux has a problem with this. There no way the router will take an external IP.
How can i workaround this problem. It must have the external ip.
Check your MSWin image's network configuration by invoking at a command line:
ipconfig /all
Compare this to what you are setting up in your RH image.
Your gateway has to have a ip address in your subnet, or you can not talk to it. If this was not the case, then there would be no reason for you to need a gateway.
the router is in the same subnet, the problem is that linux thinks its not cos it evaluates 10.0.0.138 into being on a different subnet. ( the routers subnet is deffo 255.255.255.248)
Perhaps I am misunderstanding you. I understood your first post to say that your RH box has an ip of 217.155.x.x. In your secnd post you say your router is on the same subnet as the RH box with an ip address of 10.0.0.138.
Even though your subnet masks may be the same, the two ip addresses you have given would be on different subnets because the first two octets (217.155 and 10.0) are different.
yeah yeah i know, terrible setup! its the only way i could get this crap router to work with my 8ip block from isp though. because the routers address is assinged to the ppp0a port. it won't let me assign it to eth0 as well, rediculous situation i think you'll agree. let be go though it again.
My pcs all have an address of
IP: 217.155.x.x.
SUB: 255.255.255.248
DG: 10.0.0.138
Router:
IP: 10.0.0.138
SUB: 255.255.255.248
As you say linux must calculate the subnet for the default gateway as 255.0.0.0. and therfore can't access it, windows i assume uses the subnet for the configured ip address, and therefore doesn't have a problem.
Is there a solution to make linux work in this setup?
If you have trouble getting iptables configured to do this, you might want to repost your question - phrasing it along the lines of: "how do I get iptables to redirect my default gateway address?"
After I gave you the suggestion to use iptables, I recalled that I had actually done something similar to what you are requesting (different situation, but the same end result). The distro was RH7.3, so the implementation should be similar.
1) copy your /etc/sysconfig/network-scripts/ifcfg-eth0 file to /etc/sysconfig/network-scripts/ifcfg-eth0-alias
2) edit the new file, adding lines appropriate for a device sitting on your gateway's subnet, and defining the interface as eth0:0 (i.e., DEVICE='eth0:0').
3) Modify (or create) the /etc/sysconfig/static-routes files to add a route to the gateway using your eth0:0 interface.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.