- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Make a linux box as a simple router
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 12:08 AM
тАО09-24-2004 12:08 AM
Make a linux box as a simple router
The server installed AS3U2. It has two nics. I assigned 10.0.0.2/24 to eth0 and 192.168.0.1/24 to eth1. I enabled the net.ipv4.ip_forward in /etc/sysctl.conf and reboot the server. The followed lines are the output from netstat -r command,
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
10.0.0.0 * 255.255.248.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default cluster1.as3 0.0.0.0 UG 0 0 0 eth0
I have to pcs connected with the linux box with two subnet. From 10.0.0.3 I can ping 10.0.0.2 and from 192.168.0.2 I can ping 192.168.0.1 without problem. But when I issue ping 192.168.0.2 command on the 10.0.0.3, it failed with no output. No timeout,no destination cann't be reached messages showed on the screen.
Is there anything I forget to config? Who can give me an advice? Thanks in advanced.
Yongye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 12:47 AM
тАО09-24-2004 12:47 AM
Re: Make a linux box as a simple router
did you set routing on your PC
a) 192.168.0.3 gateway must be 192.168.0.1
b) 10.0.0.3 gw 10.0.0.2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 01:13 AM
тАО09-24-2004 01:13 AM
Re: Make a linux box as a simple router
While checking the routing entries use as,
# route -n
# netstat -nr
It will give full informations there.
You can check trace routing problem's with traceroute command there.
Problem information says your routing settings are wrong there. what is the machine router informations??
Please post that informations to pin-point exact problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 01:19 AM
тАО09-24-2004 01:19 AM
Re: Make a linux box as a simple router
Destination Gateway
192.168.0.0 192.168.0.1
10.0.0.0 10.0.0.2
so that requests will be sent corresponding gateway. If that is missing and using default routing as,
default
then it will be sent through that gateway and other interface ip can not be accessible there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 04:40 AM
тАО09-24-2004 04:40 AM
Re: Make a linux box as a simple router
To have a secure router to the public Internet, you need a few things:
The gateway must be set up as discussed in prior posts on the NIC on the public Internet.
The PC's should have(this varies by isp) /etc/resolv.conf or for Windows DNS information for the outside ISP DNS name servers.
You need to turn on IP forwarding on the Linux box.
echo 1 > /proc/sys/net/ipv4/ip_forward
This document explains the setup either with ipchains(obsolete) or iptables
http://www.yolinux.com/TUTORIALS/LinuxTutorialIptablesNetworkGateway.html
Basically you need to set up SNAT NAT Address translation on the Linux box, this will enable it to handle Internet traffic on your network with stateless connection.
I can give you more direction once you've gotten some of the work above done.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 04:11 PM
тАО09-24-2004 04:11 PM
Re: Make a linux box as a simple router
Thanks for your response.
I add the default gw 10.0.0.2 on 10.0.0.3.Followed lines are output on 10.0.0.3 by issueing netstat -r
[root@lvs root]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 10.0.0.2 0.0.0.0 UG 0 0 0 eth0
But the problem still exist.
If I set up the static route table on 10.0.0.3 as Muthukumar said. Not using default gw on 10.0.0.3. Followed lines are output from netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.0.0.0 10.0.6.212 255.255.255.0 UG 0 0 0 eth0
10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
The problem still here.
And I disabled the firewall on all machines.
Yongye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 06:22 PM
тАО09-24-2004 06:22 PM
Re: Make a linux box as a simple router
Pc1 = 10.0.0.3
----------------
10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 10.0.0.2 0.0.0.0 UG 0 0 0 eth0
There is no entries regarding routing of 192.0.0.* networks so that it will be routed with 10.0.0.2 entry.
Try to make an arrangement as,
10.0.0.3 10.0.0.3
10.0.0.0 10.0.0.2
192.168.0.2 192.168.0.1
192.168.0.0 192.168.0.1
other entries there...
Rules are as,
route add -host 192.168.0.2 netmask 255.255.0.0 gw 192.168.0.1
--> metric try with 1 / 0
route add -net 192.162.0.0 gw 192.168.0.1
PS. I am not having machine to check metric so try with 0 / 1 there upto get add entry ..... there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 06:33 PM
тАО09-24-2004 06:33 PM
Re: Make a linux box as a simple router
1. Please use same ip-address there to avoid confusion there with different network there.
Example: 10.0.0.2/24 192.168.0.1/24 confusing there. try to use as,
10.0.0.2/24 192.168.0.1/24 or vice versa
2. Routing for different interface / network ip must need routing entry there on routing table. Else it will try to use default gateway there. IT will be sent there but on gateway it don't know how to go next there.
After routing table entry check as,
traceroute
To analyse which path it is going there with out simply using ping there.
3. Put associate routing entries for every network / ip-address with out sending them using default gateway. It will be the main problem when using multiple interface on router there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 06:40 PM
тАО09-24-2004 06:40 PM
Re: Make a linux box as a simple router
PC Router
10.0.0.0, * ----> 10.0.0.2
192.168.0.1
* means every other ip-address / network. So it don't know how to reach 192.168.0.* network there. So add an entry in pc as,
route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.0.1
IT will give you a chance to reach 192.168.*.* networks there easily.
If you need clarfication then ping (traceroute) us :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 07:13 PM
тАО09-24-2004 07:13 PM
Re: Make a linux box as a simple router
Thank you for your advice.
But I think on the pc(10.0.0.3).Adding the default gw(10.0.0.2) is enough. How to arrive 192.168.0.2 is the router's job. So I think it is not necessary to adding routeing table(192.168.0.0) on pc(10.0.0.3).
Yongye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2004 07:22 PM
тАО09-24-2004 07:22 PM
Re: Make a linux box as a simple router
what are you getting when you try with yoru default routing to 10.0.0.2 for,
traceroute 192.168.0.2
traceroute 192.168.0.1
traceroute 10.0.0.3
traceroute 10.0.0.2
It is good to know your routing information's there.