Linux Router Install Problems

Linux Router Install Problems

Post by Jeff Thorn » Thu, 06 Feb 2003 14:37:17



Do I need a static IP from my ISP to successfully set up a linux
router...I have tried all the guides on the net for setting this up with
no luck...

They all say to set up the gw for eth1 as the IP address of eth0...How
do I do this...I try this with route add default gw XXX.XXX.XXX.XXX eth1
where XXX is the ip of eth0...I keep getting network unreachable...eth1
cannot find the IP of eth0...

any suggestions?
Thanks
Jeff

 
 
 

Linux Router Install Problems

Post by Sybren Stuve » Thu, 06 Feb 2003 17:37:48


Jeff Thorne enlightened us with:

Quote:> Do I need a static IP from my ISP to successfully set up a linux
> router...I have tried all the guides on the net for setting this up
> with no luck...

Ok, let's assume eth0 is your connection to the internet, and eth1 is
the connection to the rest of the network. Put this in a script and run
it at boot time:

+--------------------------------------------------------------------+
#!/bin/sh

INTERN_IP="192.168.0.0/8"
EXTERN_IP="123.123.123.123"
INTERN_IF="eth1"
EXTERN_IF="eth0"

echo "Loading kernel modules"
/sbin/depmod -a
/sbin/modprobe ipt_MASQUERADE
/sbin/modprobe ip_nat_irc
/sbin/modprobe ip_conntrack_irc
/sbin/modprobe ip_conntrack_ftp

echo "Flushing old rules"
iptables -F
iptables -t nat -F

echo "Setting up masquerading"
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s $INTERN_IP -o $EXTERN_IF \
        -j SNAT --to $EXTERN_IP
+--------------------------------------------------------------------+

This is for a 2.4.x kernel with iptables. You might have to recompile
your kernel to create the probed modules. This is _not_ a secure script.
It only allows IP masquerading. I've used this script to allow my Sharp
Zaurus to connect to my network ;-)

Sybren
--
If you have to use Outlook, fix it: http://jump.to/oe-quotefix/------------------------------------------...
| Real programmers don't comment their code. It was hard to write, |
| it should be hard to read.                                       |

 
 
 

Linux Router Install Problems

Post by Cecil Rhode » Fri, 07 Feb 2003 11:56:45



> Do I need a static IP from my ISP to successfully set up a linux
> router...I have tried all the guides on the net for setting this up with
> no luck...

> They all say to set up the gw for eth1 as the IP address of eth0...How
> do I do this...I try this with route add default gw XXX.XXX.XXX.XXX eth1
> where XXX is the ip of eth0...I keep getting network unreachable...eth1
> cannot find the IP of eth0...

> any suggestions?
> Thanks
> Jeff

Is your IP static or not? If it is not you will need
to add some lines to the script that Sybren posted
previously. You will need to run dhcpcd or pump. You
will need to add a line to a file that will execute
this script when the IP changes. Please elaborate.
 
 
 

1. Problems installing Linux Router

Hi there,

I'm trying for almost two month to get this thig to work. I'm setting
up a Linux Route for Netmeeting.
The analog connections works fine but I'm getting some problems doing
the same with ISDN.
I'm getting a connection, ok, but when I try to do a ping on several
hosts I'm just getting the message "Request time out" on my Win95
machine. If I close the connection the message is "Destination Host
unreachable".

The configuration for the ippp0 looks like this (ifconfig)

ippp0   Link encap: Point-to-point
inet addr: 192.168.0.2  P-t-p: 192.168.0.122    mask 255.255.255.0
UP POINTTOPOINT RUNNING NOARP MTU:1500 Metric=1

All I want to do is to route a call through the firewall. Later on
there should be the opportunity to use Netmeeting and Intranetaccess
through this Liux router.

In my opinion the problem is the routing.
Here's my script:

Dest.           Gateway Netmask         Device
192.168.0.0     default         255.255.255.0           eth0
default                 192.168.0.1    
192.168.0.122   192.168.0.122   255.255.255.255 ippp0
192.168.0.2     default         255.255.255.255 eth0

Who can help me out of this trouble ?

Yours Ruediger Heldberg

2. Basic question about mounting a new drive?

3. Problems installing linux as router etc??

4. Paging errors during Linux ramdisk install

5. Installing a VOIP Router behind a wireless router.

6. supraexpress modems (28.8) problems w/dial-ins

7. Problem DSL Router <-> Firewall Router <-> Clients

8. The Webalizer 0.98

9. Linux/Win2K Server As A Router vs. Linksys Router (BEFSR41)

10. linux router Vs Linksys Router

11. Linux setup as IPX router and TCP/IP router??

12. Linux router vs Netopia router on DSL

13. Linux setup as IPX router and TCP/IP router??