Set a new pc router from bsd

  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2673
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post February 1st, 2008, 12:28 pm

When you say 'configuration' you mean of dhcp itself? If so, then yes you can always go back and alter the config.
"It's always a long day, 86,400 won't fit into a short."
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 1st, 2008, 12:28 pm

  • gamekiller
  • Graduate
  • Graduate
  • No Avatar
  • Joined: May 28, 2006
  • Posts: 101
  • Loc: above the chair
  • Status: Offline

Post February 6th, 2008, 2:42 am

hello guys, i think i have failed to configure the freebsd pc router, i really don't know where actually i have failed..i used this guide very very carefully..
http://www.bsdguides.org/guides/freebsd/networking/ho_router_pf.php

i give u my scenario here as well as the diagram,
actually, there is a dhcp server over here, which all the pc can connect through the net..
Image

my first network card that connected to the dhcp server lab is xl0.. it gets its ip, 10.100.100.227

the second network card is fxp0, i tried to assigned this as 192.168.10.1.
so the internal network has 192.168.10.0 as a network id along with its subnet, 255.255.255.0

My problem here is why the client, which is also freebsd, cannot get 192.168.10.xxx ? it still get the ip like this, 10.100.100.91..

When i try connect a windows client, it get the ip as automatic private address, 169.254.251.230 or 'limited or no connectivity'?

and can you give me a suggestion for what is gateway ip, option-domain-name server ip etc etc..

thanks in advance
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2673
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post February 6th, 2008, 8:54 am

The 169 is a standard setting in most system to denote there is no DHCP being offered.

You need to have gateway enabled.
You need to have nat.
You need to have dhcpd enabled and configured properly. (that includes rc.conf)
You should have BIND loaded and configured as well, to forward DNS requests.

The scope of your question really goes beyond a simple answer in this forum. You are not asking one thing, you are asking multiple things in a single query.

Essentially, snippets of your configs should be as follows (or close proximities):

Code: [ Select ]
rc.conf:
ifconfig_xl0="DHCP"
ifconfig_fxp0="inet 192.168.10.1 netmask 255.255.255.0"
gateway_enable="YES"
### DHCP server
dhcpd_enable="YES"
dhcpd_ifaces="xl0" # enabled on int. interface

### DNS server - BIND
named_enable="YES"
  1. rc.conf:
  2. ifconfig_xl0="DHCP"
  3. ifconfig_fxp0="inet 192.168.10.1 netmask 255.255.255.0"
  4. gateway_enable="YES"
  5. ### DHCP server
  6. dhcpd_enable="YES"
  7. dhcpd_ifaces="xl0" # enabled on int. interface
  8. ### DNS server - BIND
  9. named_enable="YES"



Code: [ Select ]
dhcpd.conf:

subnet 192.168.10.0 netmask 255.255.255.0 {
 range 192.168.10.100 192.168.10.200;
 option domain-name-servers 192.168.10.1;
 option domain-name "mynetwork";
 option routers 192.168.10.1;
 option broadcast-address 192.168.10.255;
 default-lease-time 86400;
 max-lease-time 86400;
}
  1. dhcpd.conf:
  2. subnet 192.168.10.0 netmask 255.255.255.0 {
  3.  range 192.168.10.100 192.168.10.200;
  4.  option domain-name-servers 192.168.10.1;
  5.  option domain-name "mynetwork";
  6.  option routers 192.168.10.1;
  7.  option broadcast-address 192.168.10.255;
  8.  default-lease-time 86400;
  9.  max-lease-time 86400;
  10. }


Code: [ Select ]
named.conf:

    forwarders {
        <single line per entry list of ips for dns resolution>
    };

zone "mynetwork" {
    type master;
    file "mynetwork.hosts";
};

zone "10.168.192.in-addr.arpa" {
    type master;
    file "10.168.192.rev";
};
  1. named.conf:
  2.     forwarders {
  3.         <single line per entry list of ips for dns resolution>
  4.     };
  5. zone "mynetwork" {
  6.     type master;
  7.     file "mynetwork.hosts";
  8. };
  9. zone "10.168.192.in-addr.arpa" {
  10.     type master;
  11.     file "10.168.192.rev";
  12. };


This is just an idea of the sorts of configs you need to ensure are complete and by no means should be indicative of a finished config example.
"It's always a long day, 86,400 won't fit into a short."
  • gamekiller
  • Graduate
  • Graduate
  • No Avatar
  • Joined: May 28, 2006
  • Posts: 101
  • Loc: above the chair
  • Status: Offline

Post February 6th, 2008, 9:59 am

thanks for your reply, by this time i cannot go to our lab, there is a holiday until next monday, and the lab wont be open.
geez.. i hate holiday..

perhaps, in this period time, i should learn more about dhcp configuration..

i just want to ask something, daemonguy, is this only three config that i should edit? Any else?

and what actually function of forwarders?
  • Janrocks
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jun 15, 2005
  • Posts: 165
  • Loc: between
  • Status: Offline

Post February 7th, 2008, 1:50 am

Quote:
The 169 is a standard setting in most system to denote there is no DHCP being offered.


I wondered why sometimes NIC's seemed to go mad and no matter what you did to them defaulted to this strange number.. I'm going to take a look at some of those strange old NIC's that I scrapped to the junkbox because they refused to allow IP to be set...
Learn something every day :lol:
  • gamekiller
  • Graduate
  • Graduate
  • No Avatar
  • Joined: May 28, 2006
  • Posts: 101
  • Loc: above the chair
  • Status: Offline

Post February 10th, 2008, 7:23 pm

i just want to ask one question..
i searching in google and end up in one forum(cant remember), some of the user said that, on one network, it cannot have more than one dhcp server, is it true?
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2673
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post February 13th, 2008, 11:09 am

Yes, those few *should* cover you -- at least in as much as these specific configurations. There are of course, base configurations that need to be set as well; I could not possibly go into everything that needs configuring to get a server up.

A forwarder is just that; it forwards requests (in this case DNS requests).

As for number of dhcp servers; true enough. In a single network segment, you can have only one dhcp server (this is discounting high availability offerings in a clustered capacity).

That does not mean you can't have 2 on the same network, but different segments.
"It's always a long day, 86,400 won't fit into a short."
  • gamekiller
  • Graduate
  • Graduate
  • No Avatar
  • Joined: May 28, 2006
  • Posts: 101
  • Loc: above the chair
  • Status: Offline

Post February 19th, 2008, 1:03 am

Hye, after a long time, my configuration still wont work..

i try to make a internet connection here.. to make sure that the client can get through the internet WITHOUT using DHCP server.. just a simple connection i guess.

the following image, describe my situation now.
Image

i already compile the kernel,using the following guide..
http://www.freebsd.org/doc/en_US.ISO885 ... -natd.html

i dont install the isc-server first since i need to test the connection from the client..so what i'have do is, put the ip for the windows client as 192.168.0.2
while the fxp0 is 192.168.0.1, and the the other nic as xl0 which connect to the dhcp lab server.. so, i still didnt get it.. here, i post a few of my configuration, it will take a long page i guess..

netstat -nr
Image

for /etc/rc.conf
Quote:
keymap="us.iso"
linux_enable="YES"
local_startup="/usr/local/etc/rc.d"
moused_enable="YES"
usbd_enable="YES"

firewall_enable="YES"
gateway_enable="YES"
firewall_type="OPEN"
ifconfig_fxp0="inet 192.168.0.1 netmask 255.255.255.0"
natd_enable="YES"
natd_interface="xl0"
natd_flags=""

ifconfig_fxp0="inet 192.168.0.1 netmask 255.255.255.0"
defaultrouter="10.100.100.1"
hostname="fxp0_card"
ifconfig_xl0="DHCP"


for ifconfig -a
Quote:
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:90:27:a6:27:69
media: Ethernet autoselect (none)
status: no carrier

xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet 10.100.100.227 netmask 0xfffffc00 broadcast 10.100.103.255
ether 00:60:08:2d:8f:c8
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active

plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000


for command ipfw -a list
Quote:
00050 123 11098 divert 8668 ip4 from any to any via xl0
00100 0 0 allow ip from any to any via lo0
00200 0 0 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
65000 139 12394 allow ip from any to any
65535 18 1805 allow ip from any to any


for ps -axwu
Quote:
root 615 0.0 0.4 1524 1016 ?? Ss 4:32PM 0:16.90 /sbin/natd -dynamic -n xl0


please guide me..if u need other configuration just tell me..

Post Information

  • Total Posts in this topic: 23 posts
  • Users browsing this forum: No registered users and 115 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.