LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-15-2006, 01:35 PM   #1
rml_85226
LQ Newbie
 
Registered: Feb 2006
Posts: 8

Rep: Reputation: 0
Need Help Configuring Linux 9 As gateway


Hi,

I have two NIC Cards in a Linux 9 box, eth 1 and eth0.
It seems that I cannot get across the Linux Box with any kind of IP traffic...


ETH1 is Lan Side, ETH0 is Wan side

LAN - ETH1 IP ADDRESS IS 192.168.100.1 (192.168.100.0/24)Network
WAN -ETH0 IP ADDRESS IS 207.98.129.204

I can ping the 192.168.100.1 (Linux Lan Interface - eth1) from my windows workstation on the LAN (from 192.168.100.3/24) I cannot ping 207.98.129.204 (WAN Side - eth0) from the LAN. I can ssh to the 192.168.100.1 address from the LAN, but I cannot ssh to the 207.98.129.204 address from the LAN...
From within the Linux Box I can ping external wan addresses, to include WWW sites.......

My IPTABLES are built for ACCEPT, POLICY ACCEPT
IPV4 Forwarding has been enabled to 1.....

It seems that I cannot get across the Linux Box with any kind of IP traffic...

ETH1 is set up for DHCPD. ETH1 provides Addresses to LAN..

Does anyone have any insight into why I cannot get IP traffic in one Linux Interface (eth1) and out the other (eth0).....


Any help would be greatly appreciated...

Thanks!!
 
Old 05-16-2006, 07:45 AM   #2
gozza11
LQ Newbie
 
Registered: Dec 2005
Location: Melbourne, Australia
Distribution: LFS: Linux From Scratch
Posts: 9

Rep: Reputation: 0
i have never had any luck with ip masquerading. depending on your distribution you could download applications for easy management.

for example, debian ipmasq.

a program that i have had working on many distributions is guide dog but i think it might be obsolete by now.

are you trying to share your internet access with your lan?

what is the exact name of the distribution?

hope i could help
goran
 
Old 05-16-2006, 08:35 AM   #3
dimis
LQ Newbie
 
Registered: May 2006
Posts: 20

Rep: Reputation: 0
try:

iptables -t nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
 
Old 05-16-2006, 09:56 AM   #4
rml_85226
LQ Newbie
 
Registered: Feb 2006
Posts: 8

Original Poster
Rep: Reputation: 0
gozza

I am using Linux Shrike 2.4.20-8...... And yes I am attempting to share internet access with my Lan..
My eth0 will be towards my ISP and eth1 will be towards my lan.....Have you had success with debian ipmasq?

dimis

I will try the

iptables -t nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT

commands this evening and see if that will work..

Thanks for the help.. Both of you!!!!

I will repost if I have or have not had success!!!
 
Old 05-17-2006, 03:46 AM   #5
gozza11
LQ Newbie
 
Registered: Dec 2005
Location: Melbourne, Australia
Distribution: LFS: Linux From Scratch
Posts: 9

Rep: Reputation: 0
yea, ipmasq worked for me. though i didnt really give it much of a run, used shorewall instead.

what dimis said should work. probably better and quicker to do it his way. more control also if you know what your doing.

glad i could help
 
Old 05-17-2006, 11:36 PM   #6
rml_85226
LQ Newbie
 
Registered: Feb 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Finally I can forward packets!!! On a recommendation, I built an rc.ipmasq file and added it to rc.local for execution..

#!/bin/sh

IPTABLES=/sbin/iptables

#All The lines below are NAT routing

# flush any old rules
$IPTABLES -F -t nat

# turn on NAT (IP masquerading for outgoing packets)
$IPTABLES -A POSTROUTING -t nat -o eth0 -j MASQUERADE

# enable IP forwarding (of incoming packets)
echo 1 > /proc/sys/net/ipv4/ip_forward

I also set my workstations for a static ip.. It does not seem to want to forward packets when I am pulling dhcp addresses from the Lan side ethernet port..

Thanks to all!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
configuring a linux machine as a gateway madhavann Linux - Networking 1 02-06-2006 05:19 AM
configuring gateway - help jhar Linux - Newbie 6 01-30-2005 08:54 AM
configuring 2nd nic/gateway spooge Slackware 2 12-24-2004 02:22 PM
Question about configuring a Linux Internet gateway tomdkat Linux - Networking 0 03-18-2004 05:34 PM
Help configuring linux server as router/gateway ldare Linux - Networking 2 04-21-2003 03:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration