LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 04-18-2013, 02:52 PM   #1
captdavid1949
LQ Newbie
 
Registered: Sep 2012
Location: Deltaville VA
Distribution: Navigatrix
Posts: 21

Rep: Reputation: Disabled
How to add a static route to wired router without dropping wifi internet.


Trying to educate myself on network routing and have run into a problem I think I know the solution to, just don't know how to fix it. Explantions found in searches are way past my learning curve.

Fedora 17 (Xfce4.10)
(wlan0) Wireless nic used for internet gateway
Reserved DHCP address 192.168.1.3
Gateway address 192.168.1.1

(em1) wired network card
Presently no assigned ip address
Want to connect to another wireless router via ethernet
Gateway address 192.168.2.1

A little history... figured out in order to connect to both routers at the same time,I needed to change the ip of the wired router, and that went ok. Problems start when I leave the wired router configured as a DHCP server. If I connect to the wired lan, I loose the internet routing on the wireless lan. Disconnect from the wired lan and it's back. Not loosing the wireless connection just the internet path. Assume Fedora is assigning higher priority to the wired DHCP server and looking for a path to the internet which doesn't exist.

Ok, disable DHCP on the wired router. Problem is now the "Network Connections Manager" is asking the router for an address, which it cannot supply.

Assume I need to set up a "static route" on both my box and the wired router so they can find each other. Don't mind futzing with the settings on the router (Love that reset button) but am more than a little leery about messing with etc/sysconfig files without a little guidance.

The Fedora documentation is a little dense, so any pointers would be appreciated.

TIA

----------Edit------------
After some additional searching tried the following with both networks connected and DHCP running on both
Code:
[david@wilson ~]$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.2.1     0.0.0.0         UG    0      0        0 em1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 em1

[david@wilson ~]$ sudo route del default gw 192.168.2.1
[david@wilson ~]$ sudo route add default gw 192.168.1.1

[david@wilson ~]$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 em1
Thought I had a (temporary) solution. However running
ping google.com
resulted in a return from 192.168.2.0 not google's ip (?) No internet access as before
despite the right gateway

The search continues grasshopper..

Last edited by captdavid1949; 04-18-2013 at 03:43 PM.
 
Old 04-18-2013, 07:53 PM   #2
captdavid1949
LQ Newbie
 
Registered: Sep 2012
Location: Deltaville VA
Distribution: Navigatrix
Posts: 21

Original Poster
Rep: Reputation: Disabled
Solved... sort of

Simple.. but like the jitterbug it plumb evaded me.

In network manager edit the current wired connection and change from "Automatic"
to Automatic (DHCP) Addresses only
Save and exit

Open Terminal
# route del default gw xxx.xxx.xxx.xxx (wired connection gateway)
# route add default gw xxx.xxx.xxx.xxx (wireless connection gateway)

Done! Internet access available with both networks up, running DHCP.

Note: Found this to work only until I disconnected from wired network. Upon reconnection default gateway reverted to wired network. Work around is as follows:

Open file /etc/sysconfig/network-scripts/ifcfg-[my-wired-connection-name]
Change Entries DEFROUTE=yes and IPV6_DEFROUTE=yes to =no
Save changes

"Your Mileage May Vary" as I have probably done a bunch of things that ain't right, but it works for me.


David

Last edited by captdavid1949; 04-18-2013 at 08:38 PM.
 
  


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
permanently add static route glock19 Linux - Networking 27 07-27-2015 04:59 PM
ADSL WIFI ROUTER, SETTING DIFERENT IP RANGES BETWEEN WIRED and WIFI Corsari Linux - Networking 12 12-12-2012 08:27 AM
Wired network static IP default route won't save correctly in Ubuntu 9.10 Skaperen Linux - Networking 1 12-29-2009 10:13 PM
Static LAN (wired and WiFi) IP in Debian setup problems. CloudyWizzard Debian 15 03-29-2009 02:07 AM
Static route to a router? Milkman00 Linux - Networking 9 02-09-2003 11:11 AM


All times are GMT -5. The time now is 08:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration