LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 08-01-2004, 07:44 AM   #1
himyuza
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Rep: Reputation: 0
routes


I have setup a freebsd box and have gave it 2 IP addresses, one internal and one public. How can I route all trafic over the internal network to my router on 10.0.0.138

84.xx.xx.77
Router
10.0.0.138/8
|
|
|
Switch
|
|
FreeBSD box
84.xx.xx.76/30
10.0.0.2/8


I hope that incredibly bad diagram helps a little.
 
Old 08-01-2004, 02:02 PM   #2
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
I am confused here. If the setup is as simple as you say (the two computers with the router actually having the external access) why do you need to route the network traffic manually?

It should happen automatically as long as you have your netmasks set correctly. It should know to look for 10.0.0.x addresses on the local network.

But, Say you had a network that went like this:

router a 172.23.23.1 ------- bunch of computers 172.23.23.x
172.23.24.253
|
|
|
172.23.23.253
router b 172.23.24.1------ bunch of computers 172.23.24.x

On all the computers BEHIND router a you would need issue the command
Code:
route -n add -net 172.23.24 172.23.23.1
And for the computers behind router b you would need to issue the command
Code:
route -n add -net 172.23.23 172.23.24.1
Each router would have two network cards (one on each network). 172.23.x.1 for the local network they control and 172.23.x.253 for their connection to the other network they don't control.

You would setup something like this only in very special circumstances (I can think of one off the top of my head -- having one network firewalled from the other). And I don't think this is what you are trying to do.
 
Old 08-01-2004, 02:06 PM   #3
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
Note: If you have one network card in each machine assigning two ip addresses to each will never work the way you intend it to. The machine will allways SEND as its primary ip even if it will answer to both. So, you will be able to "hear" one network but not send on it. I hope that makes sense. Again, I am not real clear on what you are trying to do.

If you detailed your network cards, what addresses they are bound to (* the primary) and where your external connection is coming from that would be great.

Last edited by frob23; 08-01-2004 at 02:07 PM.
 
Old 08-01-2004, 02:49 PM   #4
himyuza
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Original Poster
Rep: Reputation: 0
Ok let me start again.



I have 7 PCs on a network and 1 server (Freebsd). I have been given 2 IP addresses by my ISP (block of 4). I wish to have my Freebsd server and my router to have an IP each, then the rest go on NAT.
The freebsd box doesnt have to be on NAT but i guess it would make it easier if it was?. Anyway what would be the best way to go about it.
 
Old 08-02-2004, 04:36 AM   #5
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
ethcard1 external ip
ROUTER
ethcard2 internal ip
|
|
switch --- all other internal computers
|
|
FREEBSD
one ethcard
primary address EXTERNAL ip2
alias internal ip

Now, for the most part this will work like a completely internal network. Your router should be told that all requests for your second external ip address should go to the FreeBSD INTERNAL address. All the other computer will see the FreeBSD box as being on the network.

The only other thing you have to do is let the other internal computers know the second external ip is trusted (if you want to... and you shouldn't need to). If they are BSD boxen you can hardcode the route in them (route add -host extip2 internalipforfreebsd) or you can have the router redirect that address on both interfaces to the correct box.

I hope that makes sense. Basically, the computer will respond on the network but all of its sending ip addresses will have the external ip.
 
Old 08-03-2004, 03:20 AM   #6
himyuza
LQ Newbie
 
Registered: Aug 2004
Posts: 20

Original Poster
Rep: Reputation: 0
yep thats great, thanks!
 
Old 08-03-2004, 10:41 AM   #7
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
Good to know it worked for you. Thanks for checking in and letting everyone know.
 
  


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
Routes Obie Linux - Networking 16 04-28-2005 10:15 PM
where are routes stored? Ph0enix2003 Linux - Networking 1 06-23-2004 10:46 PM
I need some routes |Drakehash| Linux - Newbie 1 06-08-2003 12:22 AM
I need some routes |Drakehash| Linux - Networking 1 06-07-2003 02:36 PM
Multiple routes DavidPhillips Linux - Networking 2 12-03-2001 12:51 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 12:40 AM.

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