Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can not add route entry for subinterface
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dlazzar
n00b
n00b


Joined: 26 Apr 2006
Posts: 2

PostPosted: Wed Apr 26, 2006 3:54 pm    Post subject: Can not add route entry for subinterface Reply with quote

Hi all

Today I've tryed to set this configuration to my /etc/conf.d/net files:

config_eth0=( "192.168.0.101 netmask 255.255.252.0 brd 192.168.3.255"
"192.168.0.30 netmask 255.255.252.0 brd 192.168.3.255"
)
routes_eth0=( "default gw 192.168.0.251"
=====> "-net 10.4.0.0/16 via 192.168.0.1 dev eth0:1"<================
"-net 172.18.1.0/24 via 192.168.0.1"
)
But the second route "-net 10.4.0.0/16 via 192.168.0.1 dev eth0:1" doesn't work.
I try to fix the problem looking at /lib/rcscripts/net.modules.d/ifconfig line 280:

ebegin "${x}"
# Support adding IPv6 addresses easily
======> if [[ ${x} == *:* && ${x} != *'-A inet6'* ]]; then
/sbin/route add -A inet6 ${x} &>${devnull}
else
/sbin/route add ${x} &>${devnull}
fi

Like I can understand this check if is there an IPV6 route without "-A int6" parameters, but in this way any route witch use an subinterface, like "eth0:1" is interpreted like an IPV6 route, I change that line in this way is that correct?
(adding a second ":" after "*:*" )

======> if [[ ${x} == *:*: && ${x} != *'-A inet6'* ]]; then

But the main question is, what happen when baselayout will be updated?
Thanks in advance
David
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed Apr 26, 2006 5:36 pm    Post subject: Reply with quote

dlazzar,

Welcome to gentoo.

eth0:1 is not a real interface, for routing, use eth0 in your
Code:
"-net 10.4.0.0/16 via 192.168.0.1 dev eth0"
statement.
_________________
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
dlazzar
n00b
n00b


Joined: 26 Apr 2006
Posts: 2

PostPosted: Wed Apr 26, 2006 5:48 pm    Post subject: Reply with quote

NeddySeagoon wrote:
dlazzar,

Welcome to gentoo.

eth0:1 is not a real interface, for routing, use eth0 in your
Code:
"-net 10.4.0.0/16 via 192.168.0.1 dev eth0"
statement.


Thanks NeddySeagoon, but I have this kind of problem:

I Have a sigle homed PC with Gentoo, but with 3 different ipv4 address, to have more than one istance service, listening on the same tcp port, but i need that when a send packets to some particular lans the systems use a source ip address witch is different from the primary, so using one of the two other alias.
Normaly it's works fine with multiple ethernet cards, but I'm using a very small PC....
Thanks a lot
David
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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