You are not logged in.
Hi,
I'm trying to use netcfg with 2 profiles at the same time. Here are my 2 profiles:
wlan0:
IP: 192.168.1.2
Netmask: 255.255.255.0
Gateway: 192.168.1.1
This is the card i'm using to connect to the net.
eth0:
IP: 192.168.2.2
Netmask: 255.255.255.0
I'm using this card to communicate directly with another system.
When the 2 profiles are UP at the same time, I can't access to internet. It seems that my system doesn't know that it have to use the wlan0 profile.
How can i make netcfg (or something else) use wlan0 profile to access the net, when wlan0 and eth0 profiles are up ?
Thanks
Offline
Why would you want 2 profiles up anyway, seems to me that this is asking for trouble.
Edit: nevermind first read the fipo thoroughly NeoXP.
Anyhow, I can imagine that your system is confused. After all it is working on two different IP-ranges. Have you made/tried any other solutions than mentioned? And do you have a gateway defined for eth0?
Last edited by NeoXP (2010-03-10 18:14:21)
Arch x86_64 on HP 6820s and on HP nx9420. Registered Linux User 350155, since 24-03-2004
"Everyone said that it could not be done, until someone came along who didn't know that."
Offline
I don't have this problem with networkmanager. It can manage my 2 configs.
But i want to use netcfg.
Why do I use 2 profiles ? Because my laptop is connected wireless to a router, and with rj45 to another computer (which is not connected to the router).
Offline
Celos,
you have a routing problem, usual when one connects to more then one network.
You can check with 'netstat -r'.
You can always force the routing with:
route add default gw 192.168.1.1
This can be done with netcfg but I don't remember exactly how and I am not at home to check,
but you should have a file '/etc/network.d/examples/ethernet-iproute' which has an example.
Hope that helps.
Mektub
Follow me on twitter: https://twitter.com/johnbina
Offline
Here is what i get with netstat -r:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
default 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
default wrt54gs 0.0.0.0 UG 0 0 0 wlan0
even with sudo route add default gw 192.168.1.1, i can't access to internet with my 2 profiles up.
Offline
Try route del default gw 192.168.2.1 first.
[git] | [AURpkgs] | [arch-games]
Offline
netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
default 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
default wrt54gs 0.0.0.0 UG 0 0 0 wlan0
sudo route del default gw 192.168.2.1
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
default wrt54gs 0.0.0.0 UG 0 0 0 wlan0
sudo route add default gw 192.168.1.1
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
default wrt54gs 0.0.0.0 UG 0 0 0 wlan0
default wrt54gs 0.0.0.0 UG 0 0 0 wlan0
Still doesn't work. (BTW: wrt54gs=> 192.168.1.1)
It seems I can't specify the route for eth0
Last edited by Celos (2010-03-11 18:05:43)
Offline
Celos,
your second example seems OK,
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
default wrt54gs 0.0.0.0 UG 0 0 0 wlan0so it seems that you don't need to execute 'sudo route add default gw 192.168.1.1', since this only duplicates the entry.
However I can't see why this would bring trouble. Nevertheless try it without the duplicate entry.
Also try 'ping 209.85.227.104'. This is the IP of a Google server, and by doing this we can test if there are any problems
with the DNS translation.
Mektub
Follow me on twitter: https://twitter.com/johnbina
Offline
Here is the ping:
PING 209.85.227.104 (209.85.227.104) 56(84) bytes of data.
From 192.168.2.1 icmp_seq=1 Destination Host Unreachable
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
192.168.2.1 is the eth0 IP.
And to be able to ping, the From should be 192.168.1.101 my wlan0 IP.
Offline
Celos,
can you please post the output of 'netstat -rn' ?
Mektub
Follow me on twitter: https://twitter.com/johnbina
Offline
Here it is, netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
Last edited by Celos (2010-03-11 18:50:41)
Offline
Celos,
as long as you have the entry
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0it will always try to go through eth0, which in your case its wrong.
Try to delete that route:
sudo route del default gw 192.168.2.1and check that it gets deleted.
Mektub
Follow me on twitter: https://twitter.com/johnbina
Offline
sudo route del default gw 192.168.2.1
netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
Now I can ping 209.85.227.104, but not google.com. So it seems there is a DNS problem now (how can it be fix ?).
Furthermore, the gw 192.168.2.1 is set always when the eth0 profile is loaded.
Offline
Celos,
it depends on how you are assigning your IPs, either static or through dhcp.
netcfg provides net-profiles that allow many difficult configurations.
Of course you could go the ugly way, putting the deletion of the 192.160.2.1 in /etc/rc.local and your DNS IP, most probably 192.168.1.1 since you have a Cisco, in /etc/resolv.conf.
Net-profles is cleaner, but you should read http://wiki.archlinux.org/index.php/Netcfg#net-profiles.
In /etc/network.d/examples there are some examples, in particular ethernet-iproute that
should give you a starting point.
Mektub
Follow me on twitter: https://twitter.com/johnbina
Offline
I added in my eth0 profile:
GATEWAY='192.168.1.1'
DNS=('192.168.1.1')
and it works now !
Thanks for your help !
Next step: trying to use netcfgGUI as non root and without runnin as: sudo netcfgGUI
Last edited by Celos (2010-03-11 19:52:03)
Offline