Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-06-2005, 09:55 AM
|
#1
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Rep:
|
How can I setup a Linux firewall router for my public class C IP block?
How can I setup a Linux firewall router for my public class C IP block?
My ISP has given me a T1 line with the IP's
69.25.19.0/24
69.25.19.0 Network
69.25.19.1 Gateway
69.25.19.255 Broadcast
I have a server with 2 nic cards, 1 nic card has my t1 line, the other has a cat 5 going to my switch, and I want to set it up to handle all the traffic and filter it with IPtables. How can I route all traffic through that server?
I know I have to run:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to ?????
What do I make the IP's of my 2 nic cards? What do I use as the gateway of my server with the 2 nics? What do my servers on the switch use for the gateway?
Thanks in advance.
|
|
|
09-06-2005, 10:31 AM
|
#2
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep: 
|
Do you want systems behind the firewall to have IPs from your class C, or from a private address block, like 10.0.0.0/8, or 192.168.0.0/16?
|
|
|
09-06-2005, 10:53 AM
|
#3
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Original Poster
Rep:
|
I am wanting them to have IP's from my class C block.
|
|
|
09-06-2005, 11:53 AM
|
#4
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep: 
|
Ok, then you don't want to do any natting. In fact, you should just be able to activate ip_forward, set the FORWARD chain to ACCEPT and they'll be online. You can then tighten down your security.
|
|
|
09-06-2005, 01:24 PM
|
#5
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Original Poster
Rep:
|
So I just run these:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -P FORWARD ACCEPT
What would I set the IP for eth0 and eth1?
What default gateway does the router server need? What default gateway should the other servers have?
|
|
|
09-06-2005, 01:35 PM
|
#6
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep: 
|
Assign eth0 and eth1 an IP from your class C. Set your clients to use the server as the gateway. Set your server to use your ISP's gateway.
|
|
|
09-06-2005, 01:55 PM
|
#7
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Original Poster
Rep:
|
Is there any way to keep my ISP's gateway for the "clients"? I already have a few "clients" active using the ISP's gateway
|
|
|
09-06-2005, 01:58 PM
|
#8
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep: 
|
Realistically, with it not being NAT, that might work as well. Give it a try. 
|
|
|
09-06-2005, 02:24 PM
|
#9
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Original Poster
Rep:
|
How can I get it to just forward all out bound traffic without filtering it at all?
|
|
|
09-06-2005, 02:32 PM
|
#10
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep: 
|
Code:
# iptables -P FORWARD ACCEPT
# echo 1 > /proc/sys/net/ipv4/ip_forward
Should do it 
|
|
|
All times are GMT -5. The time now is 01:00 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|