LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 08-18-2004, 08:51 AM   #1
fciuffani
LQ Newbie
 
Registered: Jun 2004
Posts: 7

Rep: Reputation: 0
Question Route to subnet exists but I get "Network unreachable" when adding default route


Code:
Hi,

I'm trying to create the default gateway on my notebook (Fedora Core 1), but I get a "SIOCADDRT: network unreachable" message. The problem is my eth0 interface on my notebook is on a different subnet than the gateway providing the internet access.

Here's a map of my network :


                       _____________________       ______________________
                       |Home Office Network|-------| Notebook           |
                       |   192.168.11.0/24 |       | 192.168.11.215     |
                       ---------------------       ----------------------
                                 |
                                 |
                       _____________________________
                      |Home Office Gateway/VPN box |
                      |  192.168.11.2              |
                      ------------------------------
                                 |
                             Wireless bridge
                                 |
                       VPN Tunnel
                                 |
                             Wireless bridge
                                 |
                       _______________________
                       |  Main Office VPN box|
                       |   192.168.12.18     |
                       -----------------------
                                 |
                                 |
                       ________________________      ______________________________
                       |  Main Office Subnet  |------| Main Office Def Gateway/FW |------ Internet
                       |   192.168.12.0/24    |      | 192.168.12.10              |
                       ------------------------      ------------------------------
                                 |
                                 |
                       ___________________________
                       |   Main Office Machines  |
                       |   192.168.12.n          |
                       ---------------------------

The VPN works. Machines in the main office can ping the notebook at the home office and vice-versa. But my next goal is to use the internet connection of the main office from the notebook at the home office. Unfortunately I use two 3Com Secure Gateway/Routers as VPN boxes and can't change the default gateways on them (the 3com box will pass the traffic for 192.168.12.0 through the tunnel and the rest to the "ISP" using the Wan interface IP Address). That's the reason I tried to adjust the routing on my notebook and make it use the main office gateway as his default gateway.

But, when I try to add the default gateway :

route add default 192.168.12.10

I get :

SIOCADDRT: Network unreachable

However when I ping 192.168.12.10, I get a response.

Here's my notebook's routing table :

 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
 192.168.11.0    *               255.255.255.0   U     0      0        0 eth0
 192.168.12.0    192.168.11.2    255.255.0.0     UG    0      0        0 eth0
 127.0.0.0       *               255.0.0.0       U     0      0        0 lo

What's wrong with this ?

Thanks,
 
Old 08-18-2004, 08:57 AM   #2
fciuffani
LQ Newbie
 
Registered: Jun 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Talking Better formatting

Hi,

I'm trying to create the default gateway on my notebook (Fedora Core 1), but I get a "SIOCADDRT: network unreachable" message. The problem is my eth0 interface on my notebook is on a different subnet than the gateway providing the internet access.

Here's a map of my network :

Code:
                       _____________________       ______________________
                       |Home Office Network|-------| Notebook           |
                       |   192.168.11.0/24 |       | 192.168.11.215     |
                       ---------------------       ----------------------
                                 |
                                 |
                       _____________________________
                      |Home Office Gateway/VPN box |
                      |  192.168.11.2              |
                      ------------------------------
                                 |
                             Wireless bridge
                                 |
                       VPN Tunnel
                                 |
                             Wireless bridge
                                 |
                       _______________________
                       |  Main Office VPN box|
                       |   192.168.12.18     |
                       -----------------------
                                 |
                                 |
                       ________________________      ______________________________
                       |  Main Office Subnet  |------| Main Office Def Gateway/FW |------ Internet
                       |   192.168.12.0/24    |      | 192.168.12.10              |
                       ------------------------      ------------------------------
                                 |
                                 |
                       ___________________________
                       |   Main Office Machines  |
                       |   192.168.12.n          |
                       ---------------------------

The VPN works. Machines in the main office can ping the notebook at the home office and vice-versa. But my next goal is to use the internet connection of the main office from the notebook at the home office. Unfortunately I use two 3Com Secure Gateway/Routers as VPN boxes and can't change the default gateways on them (the 3com box will pass the traffic for 192.168.12.0 through the tunnel and the rest to the "ISP" using the Wan interface IP Address). That's the reason I tried to adjust the routing on my notebook and make it use the main office gateway as his default gateway.

But, when I try to add the default gateway :

route add default 192.168.12.10

I get :

SIOCADDRT: Network unreachable

However when I ping 192.168.12.10, I get a response.

Here's my notebook's routing table :

Code:
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
 192.168.11.0    *               255.255.255.0   U     0      0        0 eth0
 192.168.12.0    192.168.11.2    255.255.0.0     UG    0      0        0 eth0
 127.0.0.0       *               255.0.0.0       U     0      0        0 lo
What's wrong with this ?

Thanks,
 
Old 08-18-2004, 10:23 AM   #3
arno
Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: fedora core 8, suse 10.3, ubuntu 7.10, kamikaze 7.09
Posts: 515

Rep: Reputation: 30
You only need to
remove route 192.168.12.0
and add
route add default gw 192.168.11.2
 
Old 08-18-2004, 10:56 AM   #4
fciuffani
LQ Newbie
 
Registered: Jun 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Hi Arno,

If I remove this route and set the def gw to 192.168.11.2, all packets directed to the main office subnet would go through the tunnel (correct) but all the those directed to other subnets (i.e. internet) wouldn't enter the tunnel. I assume they would bounce between the two routers.

Here's an updated shema of the network that's more complete.
Code:
                       _____________________       ______________________
                       |Home Office Network|-------| Notebook           |
                       |   192.168.11.0/24 |       | 192.168.11.215     |
                       ---------------------       ----------------------
                                 |
                                 |
                       _____________________________
                      |Home Office Gateway/VPN box |
                      | eth0 192.168.11.2          |
                      | eth1 192.168.14.2          | def gw 192.168.14.1
                      ------------------------------
                                 |
                             Wireless bridge
                                 |
                       IPSEC VPN Tunnel (between 192.168.11.0 and 192.168.12.0)
                                 |
                             Wireless bridge
                                 |
                       _______________________
                       |  Main Office VPN box|
                       | eth1 192.168.14.1   | def gw 192.168.14.2
                       | eth0 192.168.12.2   |
                       -----------------------
                                 |
                                 |
                       ________________________      ______________________________
                       |  Main Office Subnet  |------| Main Office Def Gateway/FW |------ Internet
                       |   192.168.12.0/24    |      | 192.168.12.10              |
                       ------------------------      ------------------------------
                                 |
                                 |
                       ___________________________
                       |   Main Office Machines  |
                       |   192.168.12.n          |
                       ---------------------------

It was probably a bad idea to use these boxes to do this. These 3Com OfficeConnect routers aren't bad to build a simple VPN or as firewalls, but not flexible enough to do what I need.

Thanks for your answer,
 
Old 08-18-2004, 02:11 PM   #5
arno
Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: fedora core 8, suse 10.3, ubuntu 7.10, kamikaze 7.09
Posts: 515

Rep: Reputation: 30
Sorry my fault I was to quick in reading your in-tire story, what you want is acces to the Internet.
You must simply create a proxy connection with the firewall 192.168.12.10 at the office
if you use gnome start
gnome-network-preferences
 
  


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
unable to add default route (network unreachable) beebop Linux - Networking 12 05-30-2005 11:07 AM
default route takes a "name" asouldja Linux - Networking 2 05-18-2005 03:48 PM
"route add default gw" - trouble Vijayasarathy Linux - Networking 2 03-23-2005 07:54 AM
Permanently set "route add" -host and default gw sacants Linux - Newbie 1 07-18-2003 04:04 AM
Problem with adding default route... Grim Reaper Linux - Networking 1 02-22-2003 07:29 AM


All times are GMT -5. The time now is 11:14 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration