Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

How do I remove the default route permanently?

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
Roman_Gruber
Advocate
Advocate
Posts: 3854
Joined: Tue Oct 03, 2006 8:43 am
Location: Austro Bavaria

How do I remove the default route permanently?

  • Quote

Post by Roman_Gruber » Sat Feb 24, 2007 7:52 pm

I have done a mistake in the past, by adding a default route to 10.0.0.138.

How do I remove this?

tail /var/log/messages

Code: Select all

Feb 24 20:36:17 notebook APIC error on CPU0: 40(40)
Feb 24 20:37:53 notebook dhcpcd[3604]: eth0: renewing lease of 10.0.0.1
Feb 24 20:37:53 notebook dhcpcd[3604]: eth0: leased 10.0.0.1 for 7200 seconds
Feb 24 20:37:53 notebook dhcpcd[3604]: eth0: no renewal time supplied, assuming 3600 seconds
Feb 24 20:37:53 notebook dhcpcd[3604]: eth0: no rebind time supplied, assuming 6300 seconds
Feb 24 20:37:53 notebook dhcpcd[3604]: eth0: adding IP address 10.0.0.1/24
Feb 24 20:37:53 notebook dhcpcd[3604]: eth0: adding default route via 10.0.0.138 metric 0
Feb 24 20:41:31 notebook pppd[4995]: Terminating on signal 15
When I do route del default the default route is deleted. How do I remove the default route permanently?

When I am online I lose my connection of my adsl modem, because dhcpcd adds the default route.

Thanks.
Top
erik258
Advocate
Advocate
User avatar
Posts: 2650
Joined: Tue Apr 12, 2005 8:39 pm
Location: Twin Cities, Minnesota, USA
Contact:
Contact erik258
Website

  • Quote

Post by erik258 » Sat Feb 24, 2007 8:00 pm

You desire that dhcpcd never adds the default route I think, right?
When I am online I lose my connection of my adsl modem, because dhcpcd adds the default route.
this confuses me. You dont use your adsl modem for online access, but still want it to be the default route? And if so, what is your online route meant to be used for? I know this information isn't strictly necessary to answer the question
How do I remove the default route permanently?
but there is no permanence to the routing table. dhcpcd is adding a default route when the online interface is brought up with dhcp. Therefore I am confused by what traffic you want to go where. My solution to this kind of thing (in my case it was a dial-up internet connection from a computer also behind an internet firewall) was to route local traffic to the right local gateway on a per-subnet or per-host basis, and then leaving the default route for 'online' access.
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Top
Roman_Gruber
Advocate
Advocate
Posts: 3854
Joined: Tue Oct 03, 2006 8:43 am
Location: Austro Bavaria

  • Quote

Post by Roman_Gruber » Sat Feb 24, 2007 8:04 pm

Ok, to clearify


Way 1 for Internet connection, dial up: When I do:

ifconfig eth0 10.2.3.4
pptp 10.0.0.138

Internet works with Thomson Speedtouch 510 modem.


So I am lazy: Way 2 for Internet connection: Works too.

dhcpcd eth0
route del default
pptp ant


So prefered way, would be, but this won*t work, because I get the default route added.


dhcpcd eth0
pptp ant

Thanks for your response.


Output of route, when I am in the net with way 1: just for information

Code: Select all

notebook roman # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
62.47.95.238    *               255.255.255.255 UH    0      0        0 ppp0
10.0.0.0        *               255.0.0.0       U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
default         62.47.95.238    0.0.0.0         UG    0      0        0 ppp0
notebook roman # 
Top
erik258
Advocate
Advocate
User avatar
Posts: 2650
Joined: Tue Apr 12, 2005 8:39 pm
Location: Twin Cities, Minnesota, USA
Contact:
Contact erik258
Website

  • Quote

Post by erik258 » Sat Feb 24, 2007 8:39 pm

still not sure whether you wish to use both connections at once or just override one temporarily with the other, but these commands would probably work:


dhcpcd -G eth0
pptp ant
`man dhcpcd` wrote: -G [gateway]
Prevents dhcpcd from installing default routes provided
by DHCP server. If optional gateway ip address parameter
is supplied then use it for default route.
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Top
Roman_Gruber
Advocate
Advocate
Posts: 3854
Joined: Tue Oct 03, 2006 8:43 am
Location: Austro Bavaria

  • Quote

Post by Roman_Gruber » Sat Feb 24, 2007 8:47 pm

Thanks for your answer erik258.

I don*t want any gateway.

The host ant is my modem: 10.0.0.138

I am using gentoo since may 2006 and I had added in the early stages of installing gentoo this default route. I never need this default route or never want this default route. This default route is useless on my computer. Anywhere on my computer must be something configured to get this default route. Maybe I have forgotten to disable this default route or to delete or comment the line in any config file in e.g. /etc.

Thanks for the tip. This is way number 4. 8)
erik258 wrote:still not sure whether you wish to use both connections at once or just override one temporarily with the other, but these commands would probably work:


dhcpcd -G eth0
pptp ant
`man dhcpcd` wrote: -G [gateway]
Prevents dhcpcd from installing default routes provided
by DHCP server. If optional gateway ip address parameter
is supplied then use it for default route.
Top
erik258
Advocate
Advocate
User avatar
Posts: 2650
Joined: Tue Apr 12, 2005 8:39 pm
Location: Twin Cities, Minnesota, USA
Contact:
Contact erik258
Website

  • Quote

Post by erik258 » Sat Feb 24, 2007 8:51 pm

still not sure whether you wish to use both connections at once or just override one temporarily with the other, but these commands would probably work:


dhcpcd -G eth0
pptp ant

`man dhcpcd` wrote: -G [gateway]
Prevents dhcpcd from installing default routes provided
by DHCP server. If optional gateway ip address parameter
is supplied then use it for default route.
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Top
Roman_Gruber
Advocate
Advocate
Posts: 3854
Joined: Tue Oct 03, 2006 8:43 am
Location: Austro Bavaria

  • Quote

Post by Roman_Gruber » Sat Feb 24, 2007 9:06 pm

Thanks, your way works!

I have only have one connection via eth0 to my modem: ant. Your option dhcpcd -g eth0 prevents the default route.

erik258 wrote:still not sure whether you wish to use both connections at once or just override one temporarily with the other, but these commands would probably work:


dhcpcd -G eth0
pptp ant

`man dhcpcd` wrote: -G [gateway]
Prevents dhcpcd from installing default routes provided
by DHCP server. If optional gateway ip address parameter
is supplied then use it for default route.
Top
erik258
Advocate
Advocate
User avatar
Posts: 2650
Joined: Tue Apr 12, 2005 8:39 pm
Location: Twin Cities, Minnesota, USA
Contact:
Contact erik258
Website

  • Quote

Post by erik258 » Sun Feb 25, 2007 6:29 pm

sorry, somehow that got double posted. Now I can't delete the second post!

Default routes - infact, the routing table as a whole is impermanent by nature and gets reconfigured for every time you reconfigure your networking interfaces, which usually means when you restart your computer. It could also mean just bringing the connection up, or restarting the connection.

You do need a default route if you intend to connect to IP addresses which aren't on your local subnet. However, you don't need 2. I only mention the importance of the default route for posterity's sake.
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Top
Post Reply

8 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic