Help with routing

Help with routing

Post by Thom » Tue, 25 Sep 2001 04:38:39



Hi,

I still got a few questions about routing under SuSE 7.1 . I've posted
before about this and got a couple of answers that confuse me (but thanks
for answering).
I don't know what I have to do next.
The IP's are well configured. IP-Routing is on, eth0 is a network card for
connecting to the internet. eth1 for the home-network. eth0 gets assigned a
new IP every time my PC starts up, so I can't specify a static IP. eth1 has
a static IP 192.168.0.1

Now I got the following guidelines

route add default gw <WAN-Side-IP> dev eth1

and then:

ipchains -A forward -j MASQ -s 192.168.4.0/24 -d 0.0.0.0/0
(note: this doesn't restrict anything)

Now a secong person told me after showing this line above:

NO.  A default route should only lead to the internet (eth1).  If you used
YaST2 to set up eth0, there should automatically be a -net route to your
LAN (192.168.0.0 netmask 255.255.255.0 dev eth0).
However, other boxes on your LAN should point to your LAN IP for their gw
and should have your ISP's DNS servers entered (if not running local DNS).

Another person gave me another ipchains rule:
Bij mij /sbin/ipchains -I forward -p all -j MASQ -s 192.168.1.0/24 -d
0.0.0.0/0

OK this is rather confusing. Is there someone who can tell me what I have to
do exactly,
because I'm a newbe and have screwed up my internet connection once before
by trying these kind of things.

thanks for helping me out,

T.G.

 
 
 

Help with routing

Post by philip » Wed, 26 Sep 2001 06:33:07



> Hi,

> I still got a few questions about routing under SuSE 7.1 . I've posted
> before about this and got a couple of answers that confuse me (but thanks
> for answering).
> I don't know what I have to do next.
> The IP's are well configured. IP-Routing is on, eth0 is a network card for
> connecting to the internet. eth1 for the home-network. eth0 gets assigned a
> new IP every time my PC starts up, so I can't specify a static IP. eth1 has
> a static IP 192.168.0.1

> Now I got the following guidelines

> route add default gw <WAN-Side-IP> dev eth1

> and then:

> ipchains -A forward -j MASQ -s 192.168.4.0/24 -d 0.0.0.0/0
> (note: this doesn't restrict anything)

> Now a secong person told me after showing this line above:

> NO.  A default route should only lead to the internet (eth1).  If you used
> YaST2 to set up eth0, there should automatically be a -net route to your
> LAN (192.168.0.0 netmask 255.255.255.0 dev eth0).
> However, other boxes on your LAN should point to your LAN IP for their gw
> and should have your ISP's DNS servers entered (if not running local DNS).

> Another person gave me another ipchains rule:
> Bij mij /sbin/ipchains -I forward -p all -j MASQ -s 192.168.1.0/24 -d
> 0.0.0.0/0

> OK this is rather confusing. Is there someone who can tell me what I have to
> do exactly,
> because I'm a newbe and have screwed up my internet connection once before
> by trying these kind of things.

> thanks for helping me out,

> T.G.

Mmm... It seems you're doing quite interesting things but you don't understand
them completely. Anyway, you have managed to set up your network properly and
that's a good starting point.
From what you wrote, I can state the following:
 - you have a private LAN whose network IP is 192.168.0.0 (I have the same kind
of thing at home).
 - one of your machines has a connection to the internet, and you use
masquerading to allow other machines on your LAN to access the Internet.
 - the machine directly connected to the Internet is a gateway, because it
is in between two networks (your LAN and the Internet), but it is also a
router (because it makes use of masquerading).

  I would suggest you to read the following:
  - Networking HowTo.
  - Masquerading HowTo.
  - Linux Network Administrators Guide.

  You can get the three of them at http://www.linuxdoc.org