Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Questions about Iproute2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
PyCoder
n00b
n00b


Joined: 07 Jul 2016
Posts: 9

PostPosted: Mon May 14, 2018 7:26 pm    Post subject: Questions about Iproute2 Reply with quote

Hi Guys

Whats the Iproute2 equivalent for this route command?

Code:
route add default gw 192.168.0.1 wlan0


I read some examples and tutorials but they dont work as example:

Code:
ip route add default via 192.168.0.1 dev wlan0


But like i said, it doesn't work:

Code:
root@omv:~# ip route add default via 192.168.0.1 dev wlan0
RTNETLINK answers: No such process
root@omv:~#





Can someone explain me the correct command?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon May 14, 2018 8:56 pm    Post subject: Reply with quote

PyCoder ...

Code:
# ip route add 192.168.0.0/24 via 192.168.0.1

best ... khay
Back to top
View user's profile Send private message
PyCoder
n00b
n00b


Joined: 07 Jul 2016
Posts: 9

PostPosted: Mon May 14, 2018 9:50 pm    Post subject: Reply with quote

khayyam wrote:
PyCoder ...

Code:
# ip route add 192.168.0.0/24 via 192.168.0.1

best ... khay


Not working ----> RTNETLINK answers: File exist


Here is my complete output:


Code:
root@omv:~# route -n
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0


Code:

root@omv:~# ip route add 192.168.0.0/24 via 192.168.0.1
RTNETLINK answers: File exists


Code:
root@omv:~# ip route show
default via 192.168.0.1 dev eth0
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.10
192.168.0.0/24 dev wlan0  proto kernel  scope link  src 192.168.0.11
root@omv:~# ip route del 192.168.0.0/24 via 192.168.0.1
RTNETLINK answers: No such process


Code:

root@omv:~# ip route show
default via 192.168.0.1 dev eth0
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.10
192.168.0.0/24 dev wlan0  proto kernel  scope link  src 192.168.0.11



But "route add default gw 192.168.0.1 wlan0" works... :(

Code:
root@omv:~# route -n
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue May 15, 2018 12:38 am    Post subject: Reply with quote

PyCoder ...

is wasn't clear from your initial description you wanted two "default" routes. The reason it's "default" is that, as the name suggests, this is a singular parameter for a given system, it can be done (see here and here) but I don't think you actually want this (because from the above it seems they both point to that one gateway). So, why do you think you need this?

best ... khay
Back to top
View user's profile Send private message
PyCoder
n00b
n00b


Joined: 07 Jul 2016
Posts: 9

PostPosted: Tue May 15, 2018 1:14 pm    Post subject: Reply with quote

khayyam wrote:
PyCoder ...

is wasn't clear from your initial description you wanted two "default" routes. The reason it's "default" is that, as the name suggests, this is a singular parameter for a given system, it can be done (see here and here) but I don't think you actually want this (because from the above it seems they both point to that one gateway). So, why do you think you need this?

best ... khay


My problem is... i have eth0 and wlan0 but wlan0 is not able to ping something outside of my lan e.g. google.com

I posted my problem here: https://forum.openmediavault.org/index.php/Thread/22875-Wifi-wlan0-not-working-outside-of-my-LAN/?postID=174896#post174896

But no1 could help me, so i decided to ask my old trusty gentoo boys :)


I know the Thomas Krenn Howto but its not working ether ---> same error msg (file exists or ressource not found)
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Tue May 15, 2018 3:16 pm    Post subject: Reply with quote

you could add routes_wlan0="default via 192.168.0.1" in /etc/conf.d/net
or you could bridge the two interface and use the bridge route to reach the gw (see https://wiki.gentoo.org/wiki/Network_bridge)

And you should also have a default route for localhost, something you are lacking. Do you lack loopback init.d service in boot runlevel?


And the error "file exist" is just telling you that this route is already create, so it doesn't work because the route exists, but the command do works.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Tue May 15, 2018 5:07 pm    Post subject: Reply with quote

PyCoder,

Two interfaces in the same subnet is usually a very bad thing.
Tell us what you want to achieve.

iproute2 tries to protect you from yourself a little more than the route command.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue May 15, 2018 6:02 pm    Post subject: Reply with quote

Moved from Networking & Security to Unsupported Software. OP is apparently running OpenMediaVault, not Gentoo, so it fits better here.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum