The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
AIX 5.3 Routing BlitzSonik UNIX for Dummies Questions & Answers 1 06-05-2007 07:03 AM
Routing jaibw Linux 2 11-27-2005 07:36 PM
routing big123456 UNIX for Advanced & Expert Users 4 11-22-2005 01:45 AM
Routing DevilGREEN IP Networking 9 11-05-2001 04:08 AM
Routing john fli IP Networking 1 05-21-2001 08:39 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-20-2003
Registered User
 

Join Date: Aug 2003
Location: newcastle
Posts: 4
Question routing

Can anyone help with the following;

I am working on a unix server (Apple OS X Server). We have two network cards in the server. Both cards are on different subnets i.e en1 is on 192.168.10.10/24 and the built in ethernet is on 10.10.150.10/24. From a computer plugged into en1 (and set to ip address 192.168.10.100) I can ping 192.168.10.10 AND 10.10.150.10. This also works in the opposite direction.

The problem is I want to be able to ping anything on 192.168.10.0 and 10.10.150.0. i.e. I want the server to route between the two network cards. I also want to add static routes in so that each subnet can use a router configured on the 192.168.10.0 network.

Possibly not a newbie question, but as far as unix is concerned, newbie pretty much describes me.

Thanks,

Martin
Forum Sponsor
  #2 (permalink)  
Old 08-20-2003
Neo's Avatar
Neo Neo is offline
Administrator
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 4,299
Is your OS X server configured to act as a router (forwarding packets)?

Also see:

http://www.osxfaq.com/man/1/netstat.ws
  #3 (permalink)  
Old 08-20-2003
Registered User
 

Join Date: Aug 2003
Location: newcastle
Posts: 4
Thanks Neo,

Nope - the only configuration is to give the interfaces ip addresses and subnets. The internet gateway sits on 10.10.150.1. This is configured on the appropriate interface.

Martin
  #4 (permalink)  
Old 08-20-2003
Neo's Avatar
Neo Neo is offline
Administrator
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 4,299
In most versions of UNIX there is a kernel level configuration that needs to be set to enable routing (packet forwarding). Also, please post the output of netstat -r.
  #5 (permalink)  
Old 08-21-2003
Registered User
 

Join Date: Aug 2003
Location: newcastle
Posts: 4
Hi Neo,

I've turned on ip forwarding (I think ) by ;

sudo sysctl -w net.inet.ip.forwarding=1

The output from netstat -r was;

[Macintosh_tes:~] martinh% netstat -r
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif Expire
default 10.1.10.1 UGSc 5 19 en0
10 link#6 UCS 2 0 en0
10.1.10.1 0:10:db:1:39:70 UHLW 7 22 en0 868
10.10.10.2 0:6:29:38:f0:52 UHLW 0 12 en0 937
10.10.150.10 localhost UHS 0 6 lo0
localhost localhost UH 20 861949 lo0
169.254 link#6 UCS 0 0 en0
192.168.10 link#4 UCS 1 0 en2
192.168.10.10 localhost UHS 0 0 lo0
192.168.10.150 0:0:39:3e:ee:f3 UHLW 0 12 en2 1197

Internet6:
Destination Gateway Flags Netif Expire
UH lo0
fe80::%lo0 Uc lo0
link#1 UHL lo0
fe80::%en2 link#4 UC en2
0:0:94:d2:3c:f6 UHL lo0
fe80::%en0 link#6 UC en0
0:30:65:d6:c6:a UHL lo0
ff01:: U lo0
ff02::%lo0 UC lo0
ff02::%en2 link#4 UC en2
ff02::%en0 link#6 UC en0
[Macintosh_tes:~] martinh%


Hope this makes sense.

Martin
  #6 (permalink)  
Old 08-21-2003
Registered User
 

Join Date: Aug 2003
Location: newcastle
Posts: 4
Sorted,

sudo sysctl -w net.inet.ip.forwarding=1 does turn on routing, however the command needs to be entered after every reboot. I know a startup script will sort this, but Apples implementation of startup scripts seems pretty weird to me (newbie remember). Also I THINK it may be possible to recompile the kernel. A simpler solution is to edit the /etc/hostconfig file so that the entry that reads;

IPFORWARDING=-NO-

Reads;

IPFORWARDING=-YES-

once this is done, it all springs into life. The only hiccup was that the internet gateway was on the 10.0.0.0/8 subnet and machines on the 192.168.10.0/24 subnet could not browse the internet. This was solved by entering a static route into the appropriate gateway,eg;

192.168.10.0/24 gateway 10.10.150.10

This tells the gateway where to find the next hop for the 192.168.10.0 network.

Thanks for the help.

Martin
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0