Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 09-20-2003, 04:06 AM   #1
LQ Newbie
Registered: Sep 2003
Location: IRC
Distribution: Debian unstable
Posts: 3

Rep: Reputation: 0
Public IPs behind router

Hello. I have little problem. I'm getting router soon and I'd like to have public IPs for every computer behind router.

MOON ( -------
HUB------ EUROPE ( ---ADSL-modem
HADES ( -----

Is it possible to get those IPs from DHCP? (so MOON eth0 sends request to EUROPE which would forward it to ADSL-modem which request address. Addresses are assigned by MAC-address (so IP is almost always same)) So I want 3 public IPs (which should be possible, becose I can get top 5 from my ISP)

Address request: MOON -> EUROPE -> Modem
Packets: Modem -> EUROPE (checks destination and is there something why it should be dropped. If there is, then it will drop it) -> DEST

Is it possible by just using dhclient eth0 and adding few IPtables rules to router (check example bellow)? Or do I need some special configuration?

iptables -A INPUT -d -j DROP
iptables -A POSTROUTUING -p tcp --dport 80 --dst -j SNAT --to-source

(yeah. I'm not very famiar with iptables yet, but point on that rule should be clear. It should block all incoming connections MOON expect connections to port 80, so it can run webserver).

Reason why I want many public is IPs is that HADES is my little brother computer. I want that he should be able to use same things (so he could example use IRC on servers which allows only one connection/IP. I don't thnk NAT will work on that).

Thank you for the answer.
Old 09-20-2003, 01:32 PM   #2
LQ Guru
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
yea u can use DHCP. in the dhcpcd.conf file, you specify the ip's that your server gives out. also, if you are using real ips, you dont have to MASQUERADE or SNAT unless you just want to make it look like all your packets are comming from 1 machine.
Old 09-20-2003, 01:36 PM   #3
LQ Guru
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
iptables -A POSTROUTUING -p tcp --dport 80 --dst -j SNAT --to-source

this rule says:

when a packet is leaving the router, going to MOON's webserver, make it look like it is comming from MOON.

i don tthink that is what u intended for that rule to say. you'd end up with moon not responding to any web requests (it would respond back to itself)


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
linux as3 working as router with 2 public IPs rajeshdogra Linux - Networking 1 07-18-2005 07:53 AM
Linux as a router but for multiple public IPs gnirtS Linux - Networking 8 03-07-2005 03:08 PM
Router with multiple public IPs Neodymium Linux - Newbie 1 04-13-2004 06:39 PM
Firewall - filter for public IPs caremaker Linux - Networking 6 01-09-2004 12:17 PM
Sharing two public IPs. Unseen Linux - Networking 8 03-20-2003 01:17 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:37 AM.

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