[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Configuration for a Linux router with a client having a public address



peasthope@shaw.ca wrote:
> Given linux router dalton, eth 3, connected to a local machine 
> carnot, eth0, with a cross-over cable, I need some help to set 
> the configurations properly.
> 
> #dalton:/etc/network/interfaces
>    ...
> iface eth3 inet static
> 	address 172.24.2.1
> 	up   route add -host 142.103.107.138
> 	down route del -host 142.103.107.138

So dalton has address 172.24.2.1 in the RFC1918 private address space.
And additionally you are adding a host route to ip address
142.103.107.138 which will be locally connected.  This seems like
trouble since you do not have a local address on that network.

> #carnot:/etc/network/interfaces
>    ...
> iface eth0 inet static
> 	address 142.103.107.138
> 	gateway 172.24.2.1

So carnot has address 142.103.107.138, missing a netmask and network
configuration, but has a gateway that is not on the local subnet?
That is trouble.  Strictly speaking it would need a gateway to reach
the defined gateway.  That isn't good.

> Obviously these specifications are deficient; but there 
> is no point in fretting details until I understand the 
> concepts.

If you want a point to point network between two machines on a
crossover cable then both hosts should be on the same subnet.

> The link must be in a network.  How can 172.24.2.1 and
> 142.103.107.138 be in one network?

You have asked the question but it is your configuration!  Why did you
configure it that way if you already realize that it won't work?
Practically they can't.  Hypothetically you could join them together
but you don't really want to do that.  Instead define a subnet for
both hosts and put each host on that subnet.

> Does carnot need a local address along with its public address?

You have given carnot the 142.103.107.138 address.  That is in the
public address space.  But it looks like it is on a private network
behind another router.

Are you trying to put a host up on the public Internet and trying to
place it behind a firewall/router?

Is dalton a router on the public Internet?  (It would help to know if
it is a WRT54G type of router or if it is a full functionality Debian
host.)  Is carnot a machine on your private network that you want to
actually host the public Internet service (HTTP, SMTP, SSH)?  Are you
trying to port forward public Internet services through dalton to
carnot?  I am guessing it is something like that.

In that case it is your public Internet router dalton that should get
the public IP address.  (Or at least an arp proxy, but I think that is
more complicated.)  Then have it port forward to carnot for the
services that you want to host on carnot.  At least this is one way to
do it.  There are several different ways.  And each of them have
subtle things that if not configured correctly will cause things not
to work as desired.

> root@dalton:~# /etc/init.d/networking restart
> Running /etc/init.d/networking restart is deprecated because it may not enable a
> gain some interfaces ... (warning).
> 
> So "networking restart" deprecated.  What is the "new way"?

The new way is with ifup and ifdown.

  sudo ifdown eth0
  sudo ifup eth0

In the old days interfaces were quite static on systems.  But with the
coming of removable and hotplug devices such as PCMCIA or USB network
interface cards there was a need to move to a more dynamic system.
Before networking needed to come online at boot time and go offline at
shutdown time.  But that isn't sufficient now.  Now devices come
online when they are plugged in and go offline when they are
disconnected.  Everything has been rewritten to be event driven.

For those of us who were used to the old static boot time system it is
a little bit of a change in mind set but a worthwhile one because of
the new capabilities that it provides.  Basically this means that you
rarely if ever should have the need to run /etc/init.d/networking stop
but would bring an individual interface offline with ifdown eth0
instead.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: