Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Network issue
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
Kurogane
n00b
n00b


Joined: 23 May 2010
Posts: 44

PostPosted: Mon Sep 24, 2012 8:31 pm    Post subject: Network issue Reply with quote

Hi folks.

I'm having problem to setup my network

Here's the scenario:

/etc/conf.d/net

Code:
config_eth0="172.16.77.42/24"


route -n

Code:
 # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
172.16.77.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0


Code:
ping -c5 172.16.0.254
PING 172.16.0.254 (172.16.0.254) 56(84) bytes of data.
64 bytes from 172.16.0.254: icmp_req=1 ttl=64 time=0.363 ms
64 bytes from 172.16.0.254: icmp_req=2 ttl=64 time=0.215 ms
64 bytes from 172.16.0.254: icmp_req=3 ttl=64 time=0.201 ms
64 bytes from 172.16.0.254: icmp_req=4 ttl=64 time=0.243 ms
64 bytes from 172.16.0.254: icmp_req=5 ttl=64 time=0.260 ms

--- 172.16.0.254 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3999ms
rtt min/avg/max/mdev = 0.201/0.256/0.363/0.058 ms


If i have this configure i can ping my network, but i dont have internet because i can't add gateway with this configuration becuase /24, if i try to add manually my gw give me this error

Code:
 # ip route add 172.16.0.0/16 via 172.16.0.254 dev eth0
RTNETLINK answers: No such process



If i add this config

/etc/conf.d/net

Code:
config_eth0="172.16.77.42/16"


Code:
# ip route add 172.16.0.0/16 via 172.16.0.254 dev eth0



route -n

Code:
 # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
172.16.0.0      172.16.0.254    255.255.255.0   UG    0      0        0 eth1
172.16.0.0      0.0.0.0         255.255.0.0   U     0      0        0 eth0


Code:
 # ping -c5 172.16.0.254
PING 172.16.0.254 (172.16.0.254) 56(84) bytes of data.
From 172.16.77.42: icmp_seq=1 Destination Host Unreachable
From 172.16.77.42: icmp_seq=2 Destination Host Unreachable
From 172.16.77.42: icmp_seq=3 Destination Host Unreachable
From 172.16.77.42: icmp_seq=4 Destination Host Unreachable
From 172.16.77.42: icmp_seq=5 Destination Host Unreachable

--- 172.16.0.254 ping statistics ---
5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4002ms
pipe 4


I can add gw but i can't ping my network so i don't know what i do wrong?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Mon Sep 24, 2012 10:45 pm    Post subject: Reply with quote

oops
_________________
Defund the FCC.


Last edited by DONAHUE on Mon Sep 24, 2012 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Mon Sep 24, 2012 10:46 pm    Post subject: Reply with quote

I have this in /etc/conf.d/net:
Code:

routes_eth0="default via [inside ip address of router on my lan]"


At boot, the system enables a default route through that ip address.
Do you not have this in your /etc/conf.d/net file?
_________________
TIA
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Tue Sep 25, 2012 4:20 am    Post subject: Re: Network issue Reply with quote

Kurogane wrote:
Hi folks.

I'm having problem to setup my network

Here's the scenario:

/etc/conf.d/net

Code:
config_eth0="172.16.77.42/24"


route -n

Code:
 # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
172.16.77.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0


Code:
ping -c5 172.16.0.254
PING 172.16.0.254 (172.16.0.254) 56(84) bytes of data.
64 bytes from 172.16.0.254: icmp_req=1 ttl=64 time=0.363 ms
64 bytes from 172.16.0.254: icmp_req=2 ttl=64 time=0.215 ms
64 bytes from 172.16.0.254: icmp_req=3 ttl=64 time=0.201 ms
64 bytes from 172.16.0.254: icmp_req=4 ttl=64 time=0.243 ms
64 bytes from 172.16.0.254: icmp_req=5 ttl=64 time=0.260 ms

--- 172.16.0.254 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3999ms
rtt min/avg/max/mdev = 0.201/0.256/0.363/0.058 ms


If i have this configure i can ping my network, but i dont have internet because i can't add gateway with this configuration becuase /24, if i try to add manually my gw give me this error

Code:
 # ip route add 172.16.0.0/16 via 172.16.0.254 dev eth0
RTNETLINK answers: No such process



Your ping here shouldn't work, you don't have a default route and you don't have any routes to reach 172.16.0.254 with. Additionally, I would expect the route add to fail, again, because you don't have a route to the suggested gateway.

When you do this:

Code:

config_eth0="172.16.77.42/16"


172.16.0.254 becomes directly routable and you can ping it without adding additional routes. If you are in fact on a /16 subnet, then this is what you should do, no additional routing necessary.
_________________
Game! - Where the stick is mightier than the sword!
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