You are not logged in.
I have an ethernet card and a wireless usb dongle; the wireless connects to a network w/internet access and the ethernet connects to a local router that just has two computers on it. My question is, how can I set up routes with netcfg and dhcpcd so that only requests to the ethernet's subnet (192.168.2.*) are handled by the ethernet card and everything else goes through the wireless router (192.168.1.1)? Right now if I take ethernet down, the internet works fine through the wireless, but as soon as I take the ethernet up, the internet goes away.
Here are my netcfg profiles:
Local:
--------
CONNECTION='ethernet'
DESCRIPTION='A basic static ethernet connection using iproute'
INTERFACE='enp4s0'
IP='static'
ADDR='192.168.2.100'
Wireless:
------------
CONNECTION='wireless'
DESCRIPTION='A simple WPA encrypted wireless connection'
INTERFACE='enp0s2f1u5'
SECURITY='wpa'
ESSID='***'
KEY='***'
IP='dhcp'
dhcpcd.conf:
-----------------
option domain_name_servers domain_name domain_search host_name'
option classless_static_routes
option ntp_servers
option interface_mtu
require dhcp_server_identifier
nohook lookup-hostname
noipv4ll
Last edited by markwitmer (2013-02-11 00:56:40)
Offline
I suggested this in a similar thread, but have you looked at ip-route?
man ip-route"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
i thank what skanky mean is the route setting.
you've to find a way that do not set any gateway of your ethernet.
otherwise it will set automatically a route to 0.0.0.0(called default route) via this ethernet gateway and then you.ve no internet connection.
[root@nas ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 205 0 0 bri0
192.168.1.0 0.0.0.0 255.255.255.0 U 205 0 0 bri0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0Offline
I think I figured out how to do this. It only required a couple minor changes to my netcfg profile. First you have to use DHCP to get your IP address instead of doing it statically. Then you pass the option -G to dhcpcd, which will inhibit the creation of a new gateway route. Ths final profile config looks like this:
CONNECTION='ethernet'
DESCRIPTION='A basic ethernet connection with no gateway'
INTERFACE='enp4s0'
IP='dhcp'
DHCP_OPTIONS='-G'Thanks for the suggestions!
Offline
Never mind. Sadly, that only worked the first time. When I rebooted my computer, netcfg once again set up two gateways -- my wireless one, and then one for the ethernet that took precedence over it. This is very annoying.
Offline
Hopefully this really did fix it... I added a line to force the deletion of any gateway route on the ethernet interface. Seems to still work after a few reboots.
CONNECTION='ethernet'
DESCRIPTION='A local ethernet connection with no gateway'
INTERFACE='enp4s0'
IP='dhcp'
IPCFG='route delete default dev enp4s0'
DHCP_OPTIONS='-G'Offline
Don't forget to mark the thread [Solved] if you've found your solution.
I laugh, yet the joke is on me
Offline