You are not logged in.

#1 2011-07-07 10:22:45

pshevtsov
Member
From: Novosibirsk, Russia
Registered: 2011-01-20
Posts: 52

[SOLVED] netcfg. DHCP and default gw

Hello!

I have got the following problem on my workstation. I'm getting IP via DHCP but it does not set proper default gateway. So, every time I boot my machine I have to run the following:

sudo route add default gw 192.168.234.254

Is there any way to make it automatically on network start? Btw, I'm using the following netcfg profile:

CONNECTION='ethernet'
DESCRIPTION='A basic dhcp ethernet connection using iproute'
INTERFACE='eth0'
IP='dhcp'

I've tried to append the line to network profile:

IPCFG=('route add default gw 192.168.234.254')

but got an error:

Error: either "to" is duplicate, or "gw" is a garbage.
 > Could not configure interface (route add default gw 192.168.234.254).

Thanks.

Last edited by pshevtsov (2011-07-12 08:12:30)

Offline

#2 2011-07-07 11:22:55

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] netcfg. DHCP and default gw

You need to look at why you're not getting the default gateway set via dhcp - workarounds as above are not solutions.

If you run dhcpcd manually, do you get the right gateway?

Offline

#3 2011-07-07 11:52:01

pshevtsov
Member
From: Novosibirsk, Russia
Registered: 2011-01-20
Posts: 52

Re: [SOLVED] netcfg. DHCP and default gw

tomk wrote:

You need to look at why you're not getting the default gateway set via dhcp - workarounds as above are not solutions.

If you run dhcpcd manually, do you get the right gateway?

I've already asked our office's sysadmin but he has not got any solution yet.
If I run dhcpcd manually I do not get the right gateway either.

Offline

#4 2011-07-07 12:47:29

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: [SOLVED] netcfg. DHCP and default gw

Wouldn't DHCP_OPTIONS="-G 192.168.234.254" in your Netcfg profile do the trick?

Offline

#5 2011-07-07 13:49:37

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [SOLVED] netcfg. DHCP and default gw

pshevtsov wrote:
tomk wrote:

You need to look at why you're not getting the default gateway set via dhcp - workarounds as above are not solutions.

If you run dhcpcd manually, do you get the right gateway?

I've already asked our office's sysadmin but he has not got any solution yet.
If I run dhcpcd manually I do not get the right gateway either.

What does netstat -rn say? FWIW, with a setup as simple as yours, I would blame the router you are getting an IP from...


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#6 2011-07-08 06:03:04

pshevtsov
Member
From: Novosibirsk, Russia
Registered: 2011-01-20
Posts: 52

Re: [SOLVED] netcfg. DHCP and default gw

Lars Stokholm wrote:

Wouldn't DHCP_OPTIONS="-G 192.168.234.254" in your Netcfg profile do the trick?

Still no luck

Leonid.I wrote:

What does netstat -rn say?

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.0.0        192.168.234.254 255.240.0.0     UG        0 0          0 eth0
10.192.0.0      192.168.234.254 255.240.0.0     UG        0 0          0 eth0
85.118.224.0    192.168.234.254 255.255.248.0   UG        0 0          0 eth0
89.31.112.0     192.168.234.254 255.255.248.0   UG        0 0          0 eth0
93.92.216.0     192.168.234.254 255.255.248.0   UG        0 0          0 eth0
172.16.0.0      192.168.234.254 255.240.0.0     UG        0 0          0 eth0
192.168.234.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0
193.124.208.0   192.168.234.254 255.255.255.0   UG        0 0          0 eth0
212.192.164.0   192.168.234.254 255.255.255.0   UG        0 0          0 eth0

Offline

#7 2011-07-08 15:36:47

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [SOLVED] netcfg. DHCP and default gw

Cool, but I meant before you set up the route manually...


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#8 2011-07-11 04:21:21

pshevtsov
Member
From: Novosibirsk, Russia
Registered: 2011-01-20
Posts: 52

Re: [SOLVED] netcfg. DHCP and default gw

Leonid.I wrote:

Cool, but I meant before you set up the route manually...

But this is the output before I set up the route. After I set up the route netstat outputs the following:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.234.254 0.0.0.0         UG        0 0          0 eth0
10.0.0.0        192.168.234.254 255.240.0.0     UG        0 0          0 eth0
10.192.0.0      192.168.234.254 255.240.0.0     UG        0 0          0 eth0
85.118.224.0    192.168.234.254 255.255.248.0   UG        0 0          0 eth0
89.31.112.0     192.168.234.254 255.255.248.0   UG        0 0          0 eth0
93.92.216.0     192.168.234.254 255.255.248.0   UG        0 0          0 eth0
172.16.0.0      192.168.234.254 255.240.0.0     UG        0 0          0 eth0
192.168.234.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0
193.124.208.0   192.168.234.254 255.255.255.0   UG        0 0          0 eth0
212.192.164.0   192.168.234.254 255.255.255.0   UG        0 0          0 eth0

Offline

#9 2011-07-12 08:11:52

pshevtsov
Member
From: Novosibirsk, Russia
Registered: 2011-01-20
Posts: 52

Re: [SOLVED] netcfg. DHCP and default gw

Solved! Added the following line to my netcfg profile:

POST_UP='route add default gw 192.168.234.254'

Last edited by pshevtsov (2011-07-12 08:12:13)

Offline

Board footer

Powered by FluxBB