View previous topic :: View next topic |
Author |
Message |
dlazzar n00b
Joined: 26 Apr 2006 Posts: 2
|
Posted: Wed Apr 26, 2006 3:54 pm Post subject: Can not add route entry for subinterface |
|
|
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 |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54815 Location: 56N 3W
|
Posted: Wed Apr 26, 2006 5:36 pm Post subject: |
|
|
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 |
|
|
dlazzar n00b
Joined: 26 Apr 2006 Posts: 2
|
Posted: Wed Apr 26, 2006 5:48 pm Post subject: |
|
|
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 |
|
|
|
|
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
|
|