Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-08-2012, 02:08 PM
|
#1
|
|
LQ Newbie
Registered: Jan 2011
Location: Austin, TX
Posts: 29
Rep:
|
How to enable ping by non-root on non-main routing tables?
I have no default route in the main routing table. I have a separate routing table created for each cellular provider that I use with the default route assigned there. I notice that if I try to execute ping through a specific interface (i.e. "ping -I ppp0 8.8.8.8") as a non-root user, that it attempts to use the main routing table (which then fails with "Network Unreachable"). However, if I run "sudo ping -I ppp0 8.8.8.8", it will correctly use the appropriate default gateway in the provider-specific routing table and work fine.
Can someone tell why the ping uses correct routing table for root, but ping for a non-root user does not?
Thank you,
Don
|
|
|
|
08-09-2012, 10:56 AM
|
#2
|
|
Member
Registered: Feb 2004
Location: Canada
Distribution: LFS SVN
Posts: 334
Rep:
|
This is a fairly simple explanation actually,
The user can't touch hardware interfaces (eth0, ppp0..etc) are hardware nodes so of course ping -I ppp0 as a user will fail, you don't have the right to access that interface.
So ping just tries to get out whatever interface is available. (if ppp0 is indeed configured and working then if you wanted to ping through ppp0 try changing the metrics of both interfaces so that ping looks at ppp0 first and not eth0.
Last edited by ProtoformX; 08-09-2012 at 10:58 AM.
|
|
|
|
08-09-2012, 11:48 AM
|
#3
|
|
LQ Newbie
Registered: Jan 2011
Location: Austin, TX
Posts: 29
Original Poster
Rep:
|
Thanks, ProtoformX, for the explanation.
However, I don't think that changing the metrics on the interfaces will solve the problem. If ping DID look for any route available, then "ping 8.8.8.8" would work for the general user when ppp0 is the only interface available. However, that does not happen unless there is a default route through ppp0 in the main routing table. I don't want to have to reconfigure the main routing table everytime the user wants to ping out a particular interface.
Does this mean there isn't a way for a general user to specify the interface to be used?
Don
|
|
|
|
08-09-2012, 12:52 PM
|
#4
|
|
Member
Registered: Feb 2004
Location: Canada
Distribution: LFS SVN
Posts: 334
Rep:
|
There is, you need to give them permission to the interface (maybe as part of a group?) but no not directly.
|
|
|
|
08-09-2012, 03:31 PM
|
#5
|
|
LQ Newbie
Registered: Jan 2011
Location: Austin, TX
Posts: 29
Original Poster
Rep:
|
This post
http://serverfault.com/questions/406...r-an-interface
indicates that ping should run as root, if owned by root (mine is). That would seem to make the use of sudo irrelevant, but it's not in my case.
I also looked at the ownership/permissions of the devices that the interfaces are being created on. The devices are created as
crw-rw-rw- root:dialout /dev/ttyUSB#
and the symlinks created for them from the udev rules show up as
lrwxrwxrwx root:root /dev/USBModem#
All users are part of the dialout group. I'm using the symlinks for pppd, but my understanding is that they are passthrough for permissions to the actual devices, so I wouldn't think that root being the group for the symlinks would matter. Strangely, changing the GROUP or MODE in the udev rules has no effect on the group/permissions of the symlinks.
Don
Last edited by donalbane; 08-09-2012 at 03:32 PM.
|
|
|
|
08-15-2012, 02:11 PM
|
#6
|
|
LQ Newbie
Registered: Jan 2011
Location: Austin, TX
Posts: 29
Original Poster
Rep:
|
I've discovered that a non-root user can successfully do:
ping -I <IPaddress> 8.8.8.8
while
ping -I <interface> 8.8.8.8
fails.
So, it doesn't seem to be a permissions issue, but rather something is wrong in the routing table configuration that prevents the interface name from properly being associated with its IP address for non-root users.
Can anyone give me a simple routing table setup procedure for 2 interfaces that will allow "ping -I <interface> 8.8.8.8" to work properly for each interface for a non-root user?
Don
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:21 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|