typical 2 NIC LAN config -- help connecting eth0 to eth1

typical 2 NIC LAN config -- help connecting eth0 to eth1

Post by me4o.. » Wed, 27 Dec 2000 14:25:27



Fellow networkers,

I'll be brief and to the point because I think that my problem should
be easy to solve.  I'm setting up a LAN on RH 7.0 with a cable modem
and 2 NIC cards.  Card 1, eth0, is connected to a 5-port switch and is
running dhcpd.  This seems to be working correctly and all of the M$
machines can get IPs and ping each and the LINUX box.  Card 2, eth1, is
connected to the cable modem and is able to ping the Internet.  The
problem I'm having is that I don't know how to give the local LAN the
ability to get to the internet.  There are a few things I've been
playing with like the LAN's default gateway and the ip-route table.
I'm guessing there is a oneliner or simple fix to get eth0 to talk to
eth1 so my LAN can access the Internet.  Suggestions and help much
appreciated !!  Thanx !!

-Mike

Sent via Deja.com
http://www.deja.com/

 
 
 

typical 2 NIC LAN config -- help connecting eth0 to eth1

Post by rtilman » Thu, 28 Dec 2000 00:08:00


You are needing  the IPMasqarading function.  It is the Linux
implementation of NAT.  Look up the IP  at:

http://www.linuxdoc.org/HOWTO/IP-Masquerade-HOWTO.html


> Fellow networkers,

> I'll be brief and to the point because I think that my problem should
> be easy to solve.  I'm setting up a LAN on RH 7.0 with a cable modem
> and 2 NIC cards.  Card 1, eth0, is connected to a 5-port switch and is
> running dhcpd.  This seems to be working correctly and all of the M$
> machines can get IPs and ping each and the LINUX box.  Card 2, eth1, is
> connected to the cable modem and is able to ping the Internet.  The
> problem I'm having is that I don't know how to give the local LAN the
> ability to get to the internet.  There are a few things I've been
> playing with like the LAN's default gateway and the ip-route table.
> I'm guessing there is a oneliner or simple fix to get eth0 to talk to
> eth1 so my LAN can access the Internet.  Suggestions and help much
> appreciated !!  Thanx !!

> -Mike

> Sent via Deja.com
> http://www.deja.com/


 
 
 

typical 2 NIC LAN config -- help connecting eth0 to eth1

Post by Hartmann Schaff » Wed, 27 Dec 2000 14:13:53



>Fellow networkers,

>I'll be brief and to the point because I think that my problem should
>be easy to solve.  I'm setting up a LAN on RH 7.0 with a cable modem
>and 2 NIC cards.  Card 1, eth0, is connected to a 5-port switch and is
>running dhcpd.  This seems to be working correctly and all of the M$
>machines can get IPs and ping each and the LINUX box.  Card 2, eth1, is
>connected to the cable modem and is able to ping the Internet.  The
>problem I'm having is that I don't know how to give the local LAN the
>ability to get to the internet.  There are a few things I've been
>playing with like the LAN's default gateway and the ip-route table.
>I'm guessing there is a oneliner or simple fix to get eth0 to talk to
>eth1 so my LAN can access the Internet.  Suggestions and help much
>appreciated !!  Thanx !!

is your kernel configured for ip forwarding?  firewalling?  what are
your ipchains rules?

hs

 
 
 

typical 2 NIC LAN config -- help connecting eth0 to eth1

Post by M. Buchenried » Thu, 28 Dec 2000 01:15:17



>Fellow networkers,
>I'll be brief and to the point because I think that my problem should
>be easy to solve.  I'm setting up a LAN on RH 7.0 with a cable modem
>and 2 NIC cards.  Card 1, eth0, is connected to a 5-port switch and is
>running dhcpd.  This seems to be working correctly and all of the M$
>machines can get IPs and ping each and the LINUX box.  Card 2, eth1, is
>connected to the cable modem and is able to ping the Internet.  The
>problem I'm having is that I don't know how to give the local LAN the
>ability to get to the internet.  

[...]

Read up on IP Masquerading and ipchains .

Michael
--

          Lumber Cartel Unit #456 (TINLC) & Official Netscum
    Note: If you want me to send you email, don't munge your address.

 
 
 

typical 2 NIC LAN config -- help connecting eth0 to eth1

Post by Russ Bix » Thu, 18 Jan 2001 12:04:10


: Fellow networkers,

: I'll be brief and to the point because I think that my problem should
: be easy to solve.  I'm setting up a LAN on RH 7.0 with a cable modem
: and 2 NIC cards.  Card 1, eth0, is connected to a 5-port switch and is
: running dhcpd.  This seems to be working correctly and all of the M$
: machines can get IPs and ping each and the LINUX box.  Card 2, eth1, is
: connected to the cable modem and is able to ping the Internet.  The
: problem I'm having is that I don't know how to give the local LAN the
: ability to get to the internet.  There are a few things I've been
: playing with like the LAN's default gateway and the ip-route table.
: I'm guessing there is a oneliner or simple fix to get eth0 to talk to
: eth1 so my LAN can access the Internet.  Suggestions and help much
: appreciated !!  Thanx !!

First, make certain that your /etc/sysctl.conf contains the following lines:

net.ipv4.ip_forward = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.ip_always_defrag = 1

Then you should execute the following:

# assuming your LAN is on the 10s and the RH7 box is at x.x.x.254 - adjust
# as needed
route add -host 10.0.0.254 eth1

# adjust this for the IP of your cable modem
route add -host 111.22.33.44 eth0

/sbin/ipchains -F

# note:  this rule set is very restrictive, and very safe - adjust as
# needed for sufficient 'net access for the RH7 box itself...
/sbin/ipchains -A input -i ! lo -j DENY
/sbin/ipchains -A output -i ! lo -j DENY
/sbin/ipchains -A forward -j DENY
/sbin/ipchains -P forward DENY

/sbin/ipchains -M -S 7200 10 60

# again, adjust as needed
/sbin/ipchains -A forward -s 10.0.0.1 -j MASQ # windoze box numero uno
/sbin/ipchains -A forward -s 10.0.0.2 -j MASQ # windoze box num...
/sbin/ipchains -A forward -s 10.0.0.3 -j MASQ
/sbin/ipchains -A forward -s 10.0.0.4 -j MASQ
/sbin/ipchains -A forward -s 10.0.0.5 -j MASQ
/sbin/ipchains -A forward -s 10.0.0.6 -j MASQ

# or...  if everything on your internal net is to be masqueraded:
# /sbin/ipchains -A forward -s 10.0.0.0/24 -j MASQ

/sbin/modprobe ip_masq_ftp
/sbin/modprobe ip_masq_raudio

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

1. eth1 problems - eth0:LAN:tulip eth1:DSL:3c509 w/ipmasq (static IP)

System:
Latest distribution (4.0 - kernel 2.2.6) of slackware. Freshly compiled
kernel with support for ipmasq and both ethernet cards (tulip:eth0 and
3c509:eth1).

Problem:
For security purposes I have substituted X.X.X.X for my static IP address
(on DSL) and Z.Z.Z.Z for my ISP's gateway machine throughout this document.

For some reason, eth1 and ipmasq functioning between eth0 and eth1 are not
working. Symptoms are described in the next few paragraphs.

From this machine or any machine on the LAN I can ping X.X.X.X but not
Z.Z.Z.Z

If I change the config files so the LAN is on eth1 and DSL is on eth0 I can
then ping Z.Z.Z.Z (also X.X.X.X & 192.168.150.1) from the linux box but I
cannot communicate with the rest of the LAN and the LAN cannot communicate
with the linux box. (I get full internet service on the linux box with this
configuration)

If I connect another computer directly to the DSL line, that machine can
reach the internet via DSL (again internet service is working correctly)

Relevant Config File Lines:

lilo.conf:
append = "ether=0,0,eth0 ether=0,0,eth1"

rc.inet1:
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

/sbin/ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up

/sbin/ifconfig eth1 X.X.X.X netmask 255.255.255.0 up

/sbin/route add default gw Z.Z.Z.Z netmask 0.0.0.0 metric 1 dev eth1

rc.firewall:
echo "1"> /proc/sys/net/ipv4/ip_forward

/sbin/ipchains -P forward DENY
/sbin/ipchains -A forward -s 192.168.0.0/24 -j MASQ -i eth1

Relevent Output From Several Commands:

/sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
X.X.X.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 X.X.X.X 0.0.0.0 UG 1 0 0 eth1

/sbin/ifconfig
eth0 Link encap:Ethernet HWaddr ##:##:##:##:##:##
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth1 Link encap:Ethernet HWaddr ##:##:##:##:##:##
inet addr:X.X.X.X Bcast:Z.Z.Z.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1

/sbin/ipchains --list -n
Chain input (policy ACCEPT):
Chain forward (policy DENY):
target  prot  opt     source          destination  ports
MASQ    all   ------  192.168.0.0/24  0.0.0.0/0    n/a

2. Swap File Size

3. eth0 and eth1 "Delaying eth0 Initialization" and "Delaying eth1 Initialization" errors

4. Installing KDE

5. eth0 and eth1 interfaces using eth0 NIC

6. Mail notification

7. ISP_One on eth1, ISP_Two on eth2, LAN on eth0, help me!

8. I am having problems with scsi tape drives.

9. Help with assigning eth0/eth1 to proper NICs

10. DHCP fails if eth0 is LAN and eth1 is DSL

11. eth0/eth1/eth2 config?!?

12. nics eth0 and eth1 got swapped in ifconfig

13. Need help with my eth0 and eth1 ISA cards (it's not what you think)