Assigning static ip address

Jerry McAllister jerrymc at msu.edu
Thu Feb 12 14:58:10 PST 2009


On Thu, Feb 12, 2009 at 10:38:02PM +0100, Nikolaj Thygesen wrote:

> Gonzalo Nemmi wrote:
> >On Thursday 12 February 2009 6:00:04 pm Nikolaj Thygesen wrote:
> >  
> >Could you plase configure your /etc/rc.conf file to something like this?
> >
> >ifconfig_ed0="inet 192.168.1.105  netmask 255.255.255.0"
> >defaultrouter="192.168.1.1"
> >
> >Where "defaultrouter" is the IP of your dhcp server and tell me what 
> >happens?
> >
> >Regards
> >  
> When I do, I get:
> 
> em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>    options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
>    ether 00:1b:21:1b:fd:bd
>    inet6 fe80::21b:21ff:fe1b:fdbd%em0 prefixlen 64 scopeid 0x1
>    inet 192.168.1.105 netmask 0xffffff00 broadcast 192.168.1.255
>    media: Ethernet autoselect (1000baseTX <full-duplex>)
>    status: active
> 
> I still get no connectivity until i run "dhclient em0" which gives me:
> 
> em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>    options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
>    ether 00:1b:21:1b:fd:bd
>    inet6 fe80::21b:21ff:fe1b:fdbd%em0 prefixlen 64 scopeid 0x1
>    inet 192.168.1.105 netmask 0xffffff00 broadcast 192.168.1.255
>    inet 10.0.0.2 netmask 0xffffff00 broadcast 10.0.0.255
>    media: Ethernet autoselect (1000baseTX <full-duplex>)
>    status: active
> 
> adding what I guess is called an alias 10.0.0.2 ip?!?! I'm not that much 
> of an expert in these matters, and I'm a bit puzzled why, at first 
> (before calling dhclient), it can't resolve addresses eventhough 
> "/etc/resolv.conf" contains all my dns's.

I think you need to turn off dhclient in /etc/rc.conf - or don't
turn it on.   Also, make sure your resolv.conf is correct and
the default router is correctly set in /etc/rc.conf to your
gateway address.    It looks like your ifconfig might be correct,
but either or both of resolv.conf or default router is wrong
or dhclient is running and clobbering them.

////jerry


> 
>    br - N
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"


More information about the freebsd-questions mailing list