1824073 Members
2699 Online
109668 Solutions
New Discussion юеВ

Re: Fedora as a router

 
SOLVED
Go to solution
Vernon Brown_4
Trusted Contributor

Fedora as a router

I have 3 PC's set up here at home. One is connected to the internet via ADSL using eth0 -> ppp0 and is the gateway to the internet for my other two PC's. Hardware setup was Ok for a couple of years running RedHat 7.1. Now I've installed Fedora Core 1 on the gateway PC. Its running Apache server and hosting 3 name based virtual hosts. This now works as expected running as a stand alone server.

I am stuck now trying to get my other two PC's on line to the internet. Everything seems to be working on the gateway box; I'm on it now; but when I bring up eth1 ( My LAN ) I can no longer access the internet from this gateway box. LAN also has no internet access.

adsl-status returns normal stuff. But when if I bring up eth1 before adsl-start ( or ifup ppp0 ) a strange entry shows up in /var/log/messages
saying eth1 not redirected from its IP.

That entry does not show up when I get ADSL successfully started with adsl-start. Success only happens if eth1 is not started.

Any ideas;

I'll probably be doing re-installs of Fedora all day :-(

Thanks for any help !!

Vern

8 REPLIES 8
Vernon Brown_4
Trusted Contributor

Re: Fedora as a router

Success !!!

Re-configured eth1's gateway address to 127.0.0.1 instead of it's network IP. Funny; the network IP worked as gateway with RedHat 7.1; probably had it wrong all these years :o)

Any comments welcome !!

Vern
Stuart Browne
Honored Contributor

Re: Fedora as a router

Remove eth1's gateway all together, it isn't needed.

ppp0 should bring a default gateway with it when it comes up.

Also make sure ip_forward is 1.
One long-haired git at your service...
Bruce Copeland
Trusted Contributor

Re: Fedora as a router

Vernon,

Stuart's on the right track. I had a similar problem in a similar network configuration after installing Fedora on my gateway/router machine. During installation, I had inadvertenly chosen the default Fedora firewall even though I use my own iptables ruleset. The gateway box was connecting to the internet just fine, but none of the other machines on the LAN could get out. The problem didn't go away until I changed the net.ipv4.ip_forward value in /etc/sysctl.conf to

net.ipv4.ip_forward = 1

Bruce
Vernon Brown_4
Trusted Contributor

Re: Fedora as a router

Thanks guys; great to know; I've been setting the gateway wrong forever.

One thing that got me on this Fedora install is that Fedora doesn't automatically do disk checks. I kept getting system hangs that required hard shutdown; after each shutdown hangs got worse; finally noticed the 2 second warning Fedora gives you to enter y for the disk check.

Now I need to turn on pop3; it doesn't seem to be in the usual xinetd.d directory. I'll try a find.

Vern
Steven E. Protter
Exalted Contributor
Solution

Re: Fedora as a router

I'm doing routing a little different Vernon.

Maybe its because my DSL is different.

in /etc/sysconfig/iptables

*nat
:PREROUTING ACCEPT [189:13041]
:POSTROUTING ACCEPT [16:2351]
:OUTPUT ACCEPT [49:9056]
-A POSTROUTING -o eth0 -j SNAT --to-source

This pretty much does it for me as far as the dsl sharing.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vernon Brown_4
Trusted Contributor

Re: Fedora as a router

Thanks Steven; I'll play around with iptables after I get pop3 working.

Your setup looks good !
KristofH
Frequent Advisor

Re: Fedora as a router

Vernon,

Something worth trying is Shorewall (www.shorewall.net), very easy if you want to add some iptables functionality without going to 'deep' into them yourself..

Just a thought.... Good luck..
Vernon Brown_4
Trusted Contributor

Re: Fedora as a router

I've looked at shorewall; interesting; I might try it if hackers keep trying to use my server as a spam terminal.