Re: Problems setting up DNS, gateway und subnetmask!
- From: "Enrique Perez-Terron" <enrio@xxxxxxxxx>
- Date: Wed, 28 Dec 2005 17:39:46 +0100
On Wed, 28 Dec 2005 01:10:04 +0100, Tamer Higazi <no@xxxxxxxx> wrote:
Hi!
I have received from my ISP an IP, DNS, Subnetmask and the DNS
Serverentries to add to my ubuntu linux machine
My interfaces File /etc/network/interfaces:
[...]
auto eth0
iface eth0 inet static
address 81.10.53.22
netmask 255.255.255.252
gateway 10.0.0.138
dns-search lan
dns-nameservers 163.121.128.134 212.103.160.18
My File /etc/hosts:
127.0.0.1 localhost.localdomain localhost ubuntu
# The following lines are desirable for IPv6 capable hosts
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
If I enter the command route:
Kernel IP Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
81.10.53.20 * 255.255.255.252 U 0 0 0 eth0
If I run explicitly this command to add the gateway to my eth0 interface:
sudo route add default gateway 10.0.0.138 eth0
I receive this errormessage:
SIOCADDRT: Das Netzwerk ist nicht erreichbar (Network unreachable)
How come that you have a routable address for the linux machine, but
a non-routable gateway address?
Given the IP and mask of the card, it should be on a network
comprising the four addresses
81.10.53.20
81.10.53.21
81.10.53.22
81.10.53.23
where the first is considered the network as such (when is that used?
I never found out that) and the last one is the broadcast address for
that network. However, the gateway address is not part of that network,
and so the routing algorithm does not know how to reach it.
Even when the gateway is reachable, routing over it does not work (for
me, at least) unless you also add a host route.
sudo route add -host 10.0.0.138 eth0
I have never understood why this is required. I seems to indicate that
the usual mechanism for direct transmission is not used for gateways,
and so I suspect that it is actually possible to use a gateway that is
not on the same network at the configured IP address/mask, thanks
to the host route. You could try it, just execute the host route
command shown above, and see if a subsequent gateway command works.
Indeed, I just tried it on my computer, and it works. (Of course I could
not try sending anything over it, but the route add commands worked; I
could list the routes with netstat -rn.)
-Enrique
.
Relevant Pages
- Re: network configuration for Eth0
... iface eth0 inet static ... 'network' and 'broadcast' are optional and gateway is necessary ... (Debian-User) - Re: network configuration for Eth0
... iface eth0 inet static ... 'network' and 'broadcast' are optional and gateway is necessary ... (Debian-User) - Re: Netwoking question
... allow-hotplug eth0 ... iface eth0 inet static ... as long as you dont have 1 pc with more than 2 network card, i dont think you need to change route.conf ... resolv.conf will deal when your linux wants to access internet, un-comment line '# gateway 192.168.0.1' after your computers able to 'pinging' each other ... (Debian-User) - Re: /etc/network/interfaces: network option
... iface eth0 inet static ... network 192.168.1.0 ... broadcast 192.168.1.255 ... gateway 192.168.1.254 ... (Debian-User) - Re: Why is adding a new Ubuntu PC to an existing LAN such a pain?
... restarting a service???? ... iface eth0 inet static ... None if your network is truly static (as I said in another post, ... but what happens when you want to replace your gateway ... (Ubuntu) |
|