How to edit, modify, override broadcast ip ??



  • hi there I not too familiar with pfsence or freebsd for that matter so I am  little stuck

    i think I figured out most..

    from my linux box router this is my routing table
    Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
    XX.xx.XX.64  0.0.0.0        255.255.255.252 U    0      0        0 eth0
    xx.xx.XX.80  0.0.0.0        255.255.255.240 U    0      0        0 eth1
    172.16.0.0      0.0.0.0        255.255.255.0  U    0      0        0 eth1
    1.1.1.0        0.0.0.0        255.255.255.0  U    0      0        0 eth2
    127.0.0.0      0.0.0.0        255.0.0.0      U    0      0        0 lo
    0.0.0.0        204.112.96.65  0.0.0.0        UG    0      0        0 eth0

    virtual lan on eth1
    ip XX.XX.XX.81
    subnet 255.255.255.240
    broadcast xx.xx.xx.95

    and  lan eth0 – (wan)
    ip xx.xx.XX.66
    subnet mask 255.255.255.252
    broadcast xx.xx.xx.255

    in that is  where my problem lies the broadcast  for  255.255.255.252 is  xx.xx.XX.67  but this broadcast is for the (ISP provided ip )  xx.xx.xx.80 -94  behind the router and for the router itself it need the broadcast of  xx.xx.xx.255.. this  is how  the linux router being setup and working for years like this so I would assume  pfsence  would need to be set the same ..

    from pfsense routing table it  matches the linux box.. I created matching  wan, lan and vlan ( parent = lan device) and used the same  ip and subnets as were in my original linux router box

    IPv4
    Destination Gateway Flags Refs Use Mtu Netif Expire
    default xx.xx.xx.65 UGS 0 1427 1500 vr0
    127.0.0.1 127.0.0.1 UH 0 0 16384 lo0
    172.16.0.0/24 link#1 UC 0 0 1500 xl0
    172.16.0.73 6c:f0:49:42:64:2b UHLW 1 374 1500 xl0 1174
    xx.xx.xx.64/30 link#2 UC 0 0 1500 vr0
    xx.xx.xx.65 link#2 UHLW 1 68 1500 vr0
    xx.xx.xx.66 00:0d:87:04:07:25 UHLW 1 51 16384 lo0
    xx.xx.xx.80/28 link#7 UC 0 0 1500 vlan0

    the only difference is the broadcast for the  router IP( xx.xx.xx.66) which is xx.xx.xx.67 but for the  ISP side it needs to be xx.xx.xx.255  while at the same time maintaining the subnet of 255.255.255.252 for the pass through

    any help on how to override the  broadcast IP for this subnet

    thank you for your time

    sash



  • humm okay  no one knows how to ???
    I did some searching on openbsd network commands.. and what they list how to do it does not work in pfsense..

    first use ifconfig to get the device info..  which works fine

    then use cat  and enter it this way to view configuration  hostname.(device name) mine is  vr0
    normally it should output this:
    cat /etc/hostname.fxp0
    inet 10.0.0.38 255.255.255.0 NONE

    then just edit this file with vi  and  change the none to my broadcast addresses

    but now the problem is does not work.. pfsense is  constructed differently then openbsd

    cat /etc/hostname.vr0  ( but this does not work say file is does not exist)

    any one have a suggestion ???? or am I missing something simple..
    thank you for your time

    okay i checked in freebsd and it somewhat similar but still does not work

    in this case it refers me to look a /etc/ rc.conf  and modify it there..  the broadcast ip.. but again it does not exist..  where is this  network interface file in pfsense ???



  • okay..  so I loaded freebsd  with a desktop and mounted your pfsense volume. so I could make sense of your  structure..  I see how it works now. via an config.xml  so it should be fairly easy to insert the broadcast option into the webpages or atleast into the  config.xml to pass it on to  the network boot process…  now I am searching through your phps and  inc files i can not find how you are parsing the  xml  to boot up process.. I think i might have Idea but a little pointing in the right direction would be easier then me mucking about until I find it..

    atleast I hope someone  can atleast  point me in that direction.  so that it might be easier to  enter a broadcast variable or something like that..  ???

    so if someone  know how the config.xml parsed as in written  description  that would be great  :) . as in  such and such  /etc/rc.xxx.ph  reads the the config.xml for  such and such line or heading..  or config.inc reads such and such from config.xml  and passes it onto such and such  to be processed to boot..  I really only worried about the lan  or wan process of the config.xml..



  • okay now I search through the phps and inc and I think I know what to to but I am a bit  stuck why it will not work

    first off , if I do this from shell it configures the card  correctly
    ifconfig dc0 172.16.3.80/28 broadcast 173.16.3.255

    now to try to edit the config script to do it automatically at  boot is where I am having the  problem. I narrowed it down to, two files /cf/conf/config.xml and /etc/inc/interfaces.inc

    I edited config.xml```

     <interfaces><lan><if>dc0</if>
    		<ipaddr>172.16.3.80</ipaddr>
    		<subnet>28</subnet>
    		<broadip>172.16.3.255</broadip>
    		 <media><mediaopt><bandwidth>100</bandwidth>
    		<bandwidthtype>Mb</bandwidthtype></mediaopt></media></lan></interfaces> 
    
    
    then edited line 157 in /etc/inc/interfaces.inc ( it seems to be the only place that looks like this may work that I found..
    to this..
    
    mwexec("/sbin/ifconfig " . escapeshellarg($lancfg['if']) . " " .
    	escapeshellarg($lancfg['ipaddr'] . "/" . $lancfg['subnet']." "."broadcast"." ".$lancfg['broadip']));
    
    
    but unfortunately it did not work  it probably the wrong line or file or argument.. but it looks like it should be the correct line  ( for some reason to me it seems to be defaulting to the backup config.xml file.. maybe there is a protection routine that causing it not to work)..  pfsense still works fine  editing this line so far that i notice it starts up fine just did not adjust the  broadcast IP..  it should not interfere with it if the value is blank it will use the default value of subnet  anyways..
    
    it really be appreciated  if someone could point me in to the direction..  if not I will keep digging  and maybe I figure out the hiccup.. or what ever I am missing..


  • okay I guess this forum you only get reply if you subscribe to the paid service ( since most queries are ignored from what i see on the forum).. which is fine you want to make money.. but why have open registration.. ???

    but anyways for those wanting or needing  custom  broadcast addresses  there are 2 methods of doing it.. but I will list the easiest install shellcmd  
    then just add your entry that way.
    example :
    ifconfig re0 172.16.16.66/30 broadcast 172.16.16.255
    this way every time you restart… you reboot with the proper configurations.
    problem after reconfiguration you may need to reboot so things are working properly. (
    when setting up your wan,lan or opt within pfsense  set it to the basic ( internet capable setting or network what ever your network priority is)
    in this case with the above example it would be 172.16.16.66/24.. ( since these special broadcast configuration in my case only allow multiple ip pass through pfsense--  but if I need the pass through priority then I set it at 172.16.16.66/30 then  these ips  will remain functional )

    I have a more eloquent method  that does not need  reboot and actual works very well even if system is  reset to defaults by mistake. the basic system will reboot into redundancy  fully operational mode, with all your basic "hardcoded" IPs settings in place--

    but this requires  some modification to  pfsense - config.xml  and adding a couple of files  advanceIP.php and advanceIP.sh



  • @sash99:

    okay I guess this forum you only get reply if you subscribe to the paid service ( since most queries are ignored from what i see on the forum).. which is fine you want to make money.. but why have open registration.. ???

    This is not true….
    You just try to do something extremely exotic.
    The way you asked, you're basically trying to break how the routing table works.
    I wouldnt be surprised if what yoi're attempting is impossible with pfSense.

    Of course you can add routes to the routingtable allowing the pfSense to communicate with this certain broadcastIP.
    But then you're not doing what you asked ;)



  • well not impossible..  working fine here.. all routes, gateways  and broadcast channels are in place and functioning fine.. the linux box using mandrake 10.0 ran it for years like this. but it is a little depreciated now ( well a lot depreciated ;) ) so there is  no reason freebsd, openbsd, nestbsd  or pfsense –would not be capable of the same routing tables..  heck you can  make dd-wrt but it usually stalls the router often  because it just does not have enough juice to keep up..

    I do not  get this "Of course you can add routes to the routingtable allowing the pfSense to communicate with this certain broadcastIP.
    But then you're not doing what you asked Wink "

    I thought i asked how to modify a broadcast ip  and make it permanent  ???   and that is what i am doing  adding specific  IPs, netmask and broadcast  ip to a routing table.. sure it not  controlled  completely by pfsense . and basically over riding any  setting  done by pfsense interface.. but it the only way i could see how to make it work easily and effectively with out having to rewrite half of pfsense..  i asked in other forums for other software routers zeroshell, ebox and other they provided some basic info to how to do it possibly ..   but i like pfsense interface and functionality  better.. so I am trying to use it if it can keep up performance wise and not unstable..

    and it really not that exotic it a very commonish business network setup.  the ISP is providing us  14 public  IPs in the 80 range and one public IP at the 66  for total of 15 public IPs  in a block of 19 IPs  to  which several servers can be connected . and one connection (66) that controls all the bandwidths throttling and control of every thing behind it ( we separate  the "public " -ip 66 from the business +81 ip).  I guess most people would not see this because one this is backbone connection and dedicated.. their  isp would put in a managed switch at the point of entry and they control all the  throttling and  what ports you can use ( at usually a ~100 dollar a month port  management fee)  we  get a chunk   and we do what we want with it and divide it up how we see fit  therefore no port fees because we manage it directly..  also it provides alot of security to snooping.. since on the same segment as us there are  +10 corporations..  the Canadian lottery, health Canada and  others ( we are not a corporation only a small  community based Internet provider for a public school, 10 small  business and 150 public clients -  on a wireless backhaul 30 mile in (also why a managed switch is not be used at point of entry- but we could but it  at the end of the  backhaul but then we would loose the  66 ip since then it would be dedicated to switch  for remote configuration)..  all these  companies  on the same segment run their network basically  the same. they  run their "public"  IP  runs on broadcast  255. and their  " private" run on other broadcast channel.. they  all can reach the internet but they are all isolated from the other companies..

    but since we are a small community base internet I have to run it on a dime  to cover the cost of a  symmetric dedicated backbone. which  are freaken expensive . also considering we move  5- 6 tetra  a month does not help much



  • The broadcast address is determined by your subnet mask. If it's not what it should be, you're using the wrong mask.


Log in to reply