"Refresh" my DHCP connection
Posts: 9
At work, when I connect to the company network using WinXP, I have to open my network connection and hit "repair" to refresh the DHCP supplied information. When XP first starts the network connection, I gets 192.168.1.1 as the default gateway. After I "repair" the connection the default gateway is the correct 192.168.1.2 needed to connect to the network and internet.
Question is, how do I "repair" under Mepis? I've tried turning eth0 off and back on, but it just retrieves the same 192.168.1.1 gateway again.
TIA,
Tom
it's odd, but I still need a workaround
Posts: 9
drlizau, that about sums it up. As far as I can tell (I'm in China and I only speak a few words of Chinese), you have to get the first gateway before you can see the second gateway. Refreshing just changes the gateway address - IP stays the same.
(edit)So, any ideas on how I can do a refresh or override just the gateway address? I can connect by entering the following:
cat > /etc/resolve.conf
nameserver 161.36.84.2
nameserver 61.144.56.100
^z
route del default
route add default gw 192.168.1.2
So, how can I automate this?(edit)
I'm a newbie to Linux (although this seems like a great distro!) so type the instructions real s l o w.
TIA
What I came up with
Posts: 9
Okay, this is what I came up with:
/usr/sbin/netRepair
<br /> #! /bin/bash<br /> echo nameserver 161.36.84.2$'\n'nameserver 61.144.56.100 > /etc/resolv.conf<br /> route del default<br /> route add default gw 192.168.1.2<br />
And on my desktop (~/Desktop/repair)
<br /> #! /bin/bash<br /> sudo netRepair<br />
Now I can jsut click on the icon for repair on my desktop and the ethernet connection is configured correctly.
It works, but was it the best way?
(edit) why are the code blocks showing HTML line break tags?
this is odd
Posts: 4864
because the dhcp server provides this information, and it routinely hands out bum information on a first connection?
you can edit this to the required numbers, but i don't think that you are attacking the cause of the problem.
perhaps a nice cup of coffee or tea for the sysadmin may produce better results?