DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 19th May 2015
libertas libertas is offline
New User
 
Join Date: Jan 2012
Posts: 7
Default How to change interface of default gateway?

Hi,

Code:
# netstat -r -f inet
Routing tables

Internet:
Destination        Gateway            Flags      Netif Expire
default            192.168.1.1        UGS        igb0
95.95.88.0/21      link#2             U          igb1
a95-95-92-226.cpe. link#2             UHS         lo0
leao               link#3             UH          lo0
127.0.0.41         link#6             UH          lo1
127.0.0.42         link#7             UH          lo2
127.0.0.43         link#8             UH          lo3
192.168.1.0        link#1             U          igb0
igb1 is set with DHCP. Default route is attributed to igb0.
Code:
# grep defaultro /etc/rc.conf
defaultrouter="192.168.1.1"
Code:
# grep igb /etc/rc.conf
ifconfig_igb0="inet 192.168.1.30 netmask 255.255.255.0"
ifconfig_igb1="DHCP"
Is the default route attributed to igb0 because it's the first interface (suffixed with 0)?
How to have default route attributed to igb1 at boot time?
Reply With Quote
  #2   (View Single Post)  
Old 20th May 2015
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,503
Default

The default route is igb0 because your /etc/rc.conf has defaultrouter="192.168.1.1" and that IP address is only reachable through your igb0 interface.

Comment out that defaultrouter line, and the default gateway should be set by DHCP to the other interface.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any info on OpenBSD 5.6's new default IPv6 to off change? SlyM OpenBSD General 4 2nd November 2014 09:45 PM
Changing Which Interface Is Assigned To Network Interface (physical) Port EverydayDiesel OpenBSD General 2 18th July 2014 10:25 AM
change default font of the X rex FreeBSD General 2 26th October 2008 05:54 PM
antivirus gateway milo974 OpenBSD Security 9 14th September 2008 04:02 AM
Permanently Change Default sound device. shep FreeBSD General 5 14th June 2008 05:58 PM


All times are GMT. The time now is 07:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick