Skip to main content

Routing through a gateway running linux...confusion ensuses

More
20 years 2 months ago #5037 by Maskkkk
I'm trying to setup a subnet using a linux gateway on my internal network.

I've read plently of stuff on using the route command to setup a static route.

Thus far my network looks like this...
There is an internet connection (DSL) which is hooked to a router (a router device, a link sis)(on network 192.168.1.0, and the routers ip is 192.168.1.1) which is hooked to the gateway (Redhat 9 Linux), the gateway has two nic cards eth0 and eth1. eth0 is connected to the routers network 192.168.1.0 with an address of 192.168.1.2 and the second interface eth1 is connected to the subnet 192.168.0.0 with an ip of 192.168.0.1

On the 192.168.0.0 segment is my laptop which has an ip of 192.168.0.105

Now I've managed to get the laptop to connect to ip's outside of my lan, but the gateway still doesn't know how to connect to ip's outside of my lan. (which really doesn't make sense if you think about it, since the laptop connects to the gate way to ping the remote, remote host.) I don't understand this...but here are the routing tables for both of them anyhow.

[code:1]
Laptop:
Destination Gateway Genmask Flags Iface
0.0.0.0 192.168.0.1 255.255.255.0 UG eth0
192.168.0.0 0.0.0.0 255.255.255.0 U eth0
127.0.0.0 0.0.0.0 255.0.0.0 U lo
0.0.0.0 192.168.0.1 0.0.0.0 UG eth0
[/code:1]

[code:1]
Gateway:
Destination Gateway Genmask Flags Iface
192.168.1.1 0.0.0.0 255.255.255.255 UH eth0
0.0.0.0 0.0.0.0 255.255.255.0 U eth0
192.168.1.0 0.0.0.0 255.255.255.0 U eth0
192.168.0.0 0.0.0.0 255.255.255.0 U eth1
127.0.0.0 0.0.0.0 255.0.0.0 U lo
0.0.0.0 192.168.1.1 0.0.0.0 UG eth0
[/code:1]

Also the laptop is not capabile of sending dns requests for some reason. Every ping to www.google.com is refused with a Network Unreachable.
I have the name servers for my ISP in /etc/resolv.conf on both the gateway and my laptop. Why is this?
There is an iptables firewall on the gateway I don't know if that has something to do with it or not. (and I don't really know how to configure it)

Thanks and if anything I wrote here wasn't to clear please let me know.

[img]http://home.pct.edu/~leeand00/Hole in the Ozone Layer.gif[/img]

- A Man is not an island...that's why we have fourms!
More
20 years 2 months ago #5039 by FallenZer0

On the 192.168.0.0 segment is my laptop which has an ip of 192.168.1.105

--Please excuse me, if I am wrong. As per the above description, your Laptop is on the 192.168.1.0 SubNetwork and NOT on the 192.168.0.0 SubNetwork. with that your Laptop, your gateway and the router are on the same subnetwork that is hooked up to the DSL and I think and I stress I think, that is why you were able to ping the remote, remote hosts.

If I were you I would double check the everything and make sure default gateways are configured properly. Hope it helps, if any.

Also, I'm curious, why you are not using one of the routers interfaces itself as a gateway to access the remote networks instead of Linux?


-There Is A Foolish Corner In The Brain Of The Wisest Man- Aristotle
More
20 years 2 months ago #5040 by Maskkkk
Okay I changed it in the previous post, sorry about that....the real address of the laptop is 192.168.0.105, it was a type-o.

Also, I'm curious, why you are not using one of the routers interfaces itself as a gateway to access the remote networks instead of Linux?


Because I'm trying to create a subnet gateway so I can later install a wireless nic card in it to create a VPN to another computer.
(But for now I'm pretty much a networking newbie...so I'm just trying to learn the basics (of subnetting) first)

That and the laptop doesn't work at my school and I'm trying to figure out how to configure it with a router/gateway. (whatever my school has)

Yes it's safe to say I don't know much about networking...
(most of all I don't understand the routing tables)

[img]http://home.pct.edu/~leeand00/Hole in the Ozone Layer.gif[/img]

- A Man is not an island...that's why we have fourms!
More
20 years 2 months ago #5044 by FallenZer0
This is what I would do. Small steps at a time.

Laptop:
IP: 192.168.0.105
Default Gateway: This should be the same IP as the IP on the router interface connected to the laptop. Give it 192.168.0.10
Subnet Mask: 255.255.255.0

Router:
The IP on the interface that is connected to the laptop should also be 192.168.0.10. The reason being if you would like to access remote networks the packets would be sent to this interface of the router for packet switching.

The IP on the other interface should be the Public IP that you would get from the DSL. This set-up will give you the ability to access the remote networks.

Now, this is the start. I am not familiar with VPN's as of yet, I'm sorry I couldn't help you any further.

-There Is A Foolish Corner In The Brain Of The Wisest Man- Aristotle
More
20 years 2 months ago #5046 by Maskkkk
Okay that gets me to where I was before.

I can ping say 216.238.41.99 (google's ip)
But I can't ping say www.google.com

Why is this?

I setup the nameserver to what all the other hosts on my network use for thier name server: 64.78.83.229

I can even ping the name server and I get a reply.... 64.78.83.229

however when I try to request a website that way it doesn't work:

[code:1]
ping www.yahoo.com
ping: unknown host www.yahoo.com
[/code:1]

Could it have something to do with the firewall on the gateway/router? DNS operates on port 53...

[img]http://home.pct.edu/~leeand00/Hole in the Ozone Layer.gif[/img]

- A Man is not an island...that's why we have fourms!
More
20 years 2 months ago #5048 by FallenZer0

Okay that gets me to where I was before.

--No. It doesn't. Mine excludes the Linux box completely. If all you want the Linux box to do is act like a gateway, as I've mentioned before, the router can do it.

I setup the nameserver to what all the other hosts on my network use for thier name server: 64.78.83.229

--Where did the DNS came from all of a sudden?


-There Is A Foolish Corner In The Brain Of The Wisest Man- Aristotle
Time to create page: 0.135 seconds