cancel
Showing results for 
Search instead for 
Did you mean: 

Unlocking the potential of Sagemcom 2704N

Darsh
Grafter
Posts: 48
Thanks: 1
Registered: ‎12-03-2015

Re: Unlocking the potential of Sagemcom 2704N

Then yes, you don't need to convert 2704N into a bridge, as it is already bridging between ethernet and wifi. Just connect your Draytek to 2704N via the ethernet - and it all should simply work.
I would recommend to keep the DHCP server on the Draytek though, switching it off on the 2704N. This will keep the things simple. When sending DHCP offer to the client, 2704N sets itself as default gateway and DNS server, and I haven't yet found a way to make it work differently. So if you have Draytek serving the Internet connection, it would make sense to keep DHCP on it.

Darsh
grm
Dabbler
Posts: 14
Registered: ‎04-04-2015

Re: Unlocking the potential of Sagemcom 2704N

Thanks, will give it a try at the weekend.
grm
Dabbler
Posts: 14
Registered: ‎04-04-2015

Re: Unlocking the potential of Sagemcom 2704N

Well that was relatively painless. Configured the 2704N with a different IP, turned off DHCP and it works perfectly as an AP.
Also applied Matty's v3-A firmware and apart from me taking a while to realise the password changed to admin that was a breeze too.
Thanks again to both of you for all your efforts.
Darsh
Grafter
Posts: 48
Thanks: 1
Registered: ‎12-03-2015

Re: Unlocking the potential of Sagemcom 2704N

Optimised the MRTG scripts to use previously saved cookie to avoid logging in on each run.
#!/bin/sh
# Router PPPoA interface traffic stats for MRTG
cd /stats/mrtg
curl -s --cookie cookies.txt http://192.168.1.254/statswan.cmd > statswan.html
grep -Fq "Login Required" statswan.html
if [ $? -eq 0 ]; then
  curl -s --data "loginuser=admin&loginpasswd=<password>" --cookie-jar cookies.txt http://192.168.1.254/plusnetlogin.cgi > /dev/null
  curl -s --cookie cookies.txt http://192.168.1.254/statswan.cmd > statswan.html
fi
xmllint --html --xpath '//tr[last()]/td[position()=3]/text()' statswan.html 2> /dev/null
echo
xmllint --html --xpath '//tr[last()]/td[position()=7]/text()' statswan.html 2> /dev/null
echo
rm statswan.html

#!/bin/sh
# Router ADSL sync rate stats for MRTG
cd /stats/mrtg
curl -s --cookie cookies.txt http://192.168.1.254/statsadsl.html > statsadsl.html
grep -Fq "Login Required" statsadsl.html
if [ $? -eq 0 ]; then
  curl -s --data "loginuser=admin&loginpasswd=<password>" --cookie-jar cookies.txt http://192.168.1.254/plusnetlogin.cgi > /dev/null
  curl -s --cookie cookies.txt http://192.168.1.254/statsadsl.html > statsadsl.html
fi
xmllint --html --xpath '//tr[position()=16]/td[position()=2]/text()' statsadsl.html 2> /dev/null
echo
xmllint --html --xpath '//tr[position()=16]/td[position()=3]/text()' statsadsl.html 2> /dev/null
echo
rm statsadsl.html

Next optimisation would be to avoid writing html pages to the disk. Will think about it.

Darsh
Matty123123
Grafter
Posts: 96
Thanks: 2
Registered: ‎01-04-2015

Re: Unlocking the potential of Sagemcom 2704N

Quote from: Bob
Would anybody care to share a screen grab?

Hello, I've attached a few screen shots.....
The last one where I list the web pages.....  most dont work, because of compile-time limitations.....  but I thought I'll add them anyway for the experimenters.
Matty123123
Grafter
Posts: 96
Thanks: 2
Registered: ‎01-04-2015

Re: Unlocking the potential of Sagemcom 2704N

Quote from: 11110_110
Is it possible to view firewall logs with the stock firmware by any chance.

Try http://192.168.1.254/logintro.html >> http://192.168.1.254/logview.cmd. ; No guarantee
Matty123123
Grafter
Posts: 96
Thanks: 2
Registered: ‎01-04-2015

Re: Unlocking the potential of Sagemcom 2704N

Quote from: grm
Also applied Matty's v3-A firmware ........ ........ that was a breeze too.

Excellent,  Smiley  I've had no problems so far.
30FTTC06
Pro
Posts: 2,286
Thanks: 108
Fixes: 4
Registered: ‎18-02-2013

Re: Unlocking the potential of Sagemcom 2704N

Quote from: Matty123123
Quote from: 11110_110
Is it possible to view firewall logs with the stock firmware by any chance.

Try http://192.168.1.254/logintro.html >> http://192.168.1.254/logview.cmd.   No guarantee

No that just says your not allowed, thanks anyway.
I did try the following without success as yet, uploading the config with the lines shown below added to the bottom with no gaps, but that just stopped me gaining access to the router for some reason, I guess I must of done something wrong.
Quote from: 11110_110
Cheers Darsh, I'll have a mooch at adding ssh as well then.
[tt]<InternetGatewayDevice>
<X_BROADCOM_COM_AppCfg>
 <SshdCfg>
   <NetworkAccess>LAN</NetworkAccess>
 </SshdCfg>
</X_BROADCOM_COM_AppCfg>
<SshControl>
 <Enable>TRUE</Enable>
 <UserName>username-here</UserName>
 <Password>password-here</Password>
</SshControl>
</InternetGatewayDevice>[/tt]

[tt]<DslCpeConfig version="3.0">
 <InternetGatewayDevice>
   <X_BROADCOM_COM_SyslogCfg>
     <Status>Enabled</Status>
     <Option>local buffer</Option>
     <LocalDisplayLevel>Error</LocalDisplayLevel>
     <LocalLogLevel>Debug</LocalLogLevel>
   </X_BROADCOM_COM_SyslogCfg>
 </InternetGatewayDevice>
</DslCpeConfig>[/tt]
Quote from: Darsh
Quote from: Matty123123
Connect to fe80::XXXX:XXff:feXX:XXXX,   where the X's are the routers MAC Address.  ( I Hope )

Almost the MAC address. IPv6 link-local addresses are formed according to EUI-64, where the seventh bit of the MAC address is inverted, resulting in the first octet of the MAC address to either increase (usually) or decrease by two.
Example: MAC 0012.7feb.6b40 will produce IPv6 link-local address fe80::0212:7fff:feeb:6b40.
More info here: http://packetlife.net/blog/2008/aug/4/eui-64-ipv6/
For connecting from Linux, you need to specify the local interface you are connecting from, as link-local addresses are not meant for normal traffic use. The syntax is (with the above address and eth0 as local interface): "ssh -l <username> fe80::0212:7fff:feeb:6b40%eth0".
UPD0: Wow! It works!
UPD1: Matt, from examining the router internals dumpsysinfo command looks much more interesting than dumpmdm. 🙂
UPD2: Found a hidden iptables command, which should allow to change the firewall settings.
UPD3: And hidden sh command brings you directly to the BusyBox shell. Ah! Finally! 🙂
UPD4: Eh, pity - no snmpd anywhere 😞

Darsh


Matty123123
Grafter
Posts: 96
Thanks: 2
Registered: ‎01-04-2015

Re: Unlocking the potential of Sagemcom 2704N

Hello,
Quote from: 11110_110
uploading the config with the lines shown below added to the bottom with no gaps

hmmm, that might be problem - if I've understood you right.
You need to intergrate those (easy to read) snippets into your current config.
E.G. current Config
<?xml version="1.0"?>
<DslCpeConfig version="3.0">
<InternetGatewayDevice>
<LANDeviceNumberOfEntries>1</LANDeviceNumberOfEntries>
<WANDeviceNumberOfEntries>1</WANDeviceNumberOfEntries>
<DeviceInfo>
  <ManufacturerOUI>001556</ManufacturerOUI>
  <ProductClass>Plusnet F@ST 2704N ADSL</ProductClass>
  <FirstUseDate>0001-01-01T00:00:00Z</FirstUseDate>
  <VendorConfigFileNumberOfEntries>0</VendorConfigFileNumberOfEntries>
</DeviceInfo>
<X_BROADCOM_COM_AppCfg>
  <DnsProxyCfg>
<DeviceDomainName>lan</DeviceDomainName>
<DeviceHostName>dsldevice</DeviceHostName>
  </DnsProxyCfg>
</X_BROADCOM_COM_AppCfg>
<X_BROADCOM_COM_EthernetSwitch>
  <NumberOfVirtualPorts>4</NumberOfVirtualPorts>
  <EnableVirtualPorts>TRUE</EnableVirtualPorts>
  <IfName>NULL</IfName>
</X_BROADCOM_COM_EthernetSwitch>

Into:
<?xml version="1.0"?>
<DslCpeConfig version="3.0">
<InternetGatewayDevice>
<LANDeviceNumberOfEntries>1</LANDeviceNumberOfEntries>
<WANDeviceNumberOfEntries>1</WANDeviceNumberOfEntries>
<DeviceInfo>
  <ManufacturerOUI>001556</ManufacturerOUI>
  <ProductClass>Plusnet F@ST 2704N ADSL</ProductClass>
  <FirstUseDate>0001-01-01T00:00:00Z</FirstUseDate>
  <VendorConfigFileNumberOfEntries>0</VendorConfigFileNumberOfEntries>
</DeviceInfo>
<X_BROADCOM_COM_AppCfg>
  <DnsProxyCfg>
<DeviceDomainName>lan</DeviceDomainName>
<DeviceHostName>dsldevice</DeviceHostName>
  </DnsProxyCfg>
  <SshdCfg>
<NetworkAccess>LAN</NetworkAccess>
  </SshdCfg>
</X_BROADCOM_COM_AppCfg>
<SshControl>
  <Enable>TRUE</Enable>
  <UserName>username-here</UserName>
  <Password>password-here</Password>
</SshControl>
<X_BROADCOM_COM_SyslogCfg>
  <Status>Enabled</Status>
  <Option>local buffer</Option>
  <LocalDisplayLevel>Error</LocalDisplayLevel>
  <LocalLogLevel>Debug</LocalLogLevel>
</X_BROADCOM_COM_SyslogCfg>
<X_BROADCOM_COM_EthernetSwitch>
  <NumberOfVirtualPorts>4</NumberOfVirtualPorts>
  <EnableVirtualPorts>TRUE</EnableVirtualPorts>
  <IfName>NULL</IfName>
</X_BROADCOM_COM_EthernetSwitch>

Luckily Gaps and Leading spaces does not make a difference.
I wonder.... would people like a little program to (sort-of) easily adjust the config ?
30FTTC06
Pro
Posts: 2,286
Thanks: 108
Fixes: 4
Registered: ‎18-02-2013

Re: Unlocking the potential of Sagemcom 2704N

I wasn't aware that I needed to plug through and add it to the correct place in the existing config in the correct order, that might be what the problem is then.
I think a little program to put it all together would be a brilliant idea  Smiley
I only use Linux and OSX here.
Cheers Matty123123.
keoki
Newbie
Posts: 1
Thanks: 1
Registered: ‎23-04-2015

Re: Unlocking the potential of Sagemcom 2704N

hello. just read the entire post and now I'm more confused than when I started. Can someone please tell me step by step on how to set a 2704n into bridge mode so I use it solely as a dsl modem. I do not need any further tweaks or settings, just easiest way to turn it into a modem for my router would be very much appreciated.
grm
Dabbler
Posts: 14
Registered: ‎04-04-2015

Re: Unlocking the potential of Sagemcom 2704N

Quote from: 11110_110
Quote from: Matty123123
Quote from: 11110_110
Is it possible to view firewall logs with the stock firmware by any chance.

Try http://192.168.1.254/logintro.html >> http://192.168.1.254/logview.cmd.   No guarantee

No that just says your not allowed, thanks anyway.

EDIT: just noticed you asked about stock firmware....
With mattys FW those links work fo me:
System Log
Date/Time Facility Severity Message
Jan 5 10:56:54 syslog emerg syslogd started: BusyBox v1.17.2
Jan 5 10:56:54 daemon crit kernel: eth2 Link UP 100 mbps full duplex
Jan 5 10:56:54 daemon crit kernel: eth0 Link UP 100 mbps full duplex
Jan 5 10:56:54 daemon crit kernel: eth0 Link DOWN.
Jan 5 10:56:54 daemon crit kernel: eth0 Link UP 100 mbps full duplex
Jan 5 10:56:54 daemon crit kernel: eth0 Link DOWN.
Jan 5 10:56:54 daemon crit kernel: eth0 Link UP 100 mbps full duplex
Jan 5 10:56:54 daemon crit kernel: eth0 Link DOWN.
Jan 5 10:56:54 daemon crit kernel: eth0 Link UP 100 mbps full duplex
Jan 5 10:56:54 daemon crit kernel: eth0 Link DOWN.
Jan 5 10:56:54 daemon crit kernel: eth0 Link UP 100 mbps full duplex
Jan 5 10:56:54 daemon crit kernel: eth0 Link DOWN.
Jan 5 10:56:54 daemon crit kernel: eth0 Link UP 100 mbps full duplex
Jan 5 10:56:54 daemon crit kernel: eth0 Link DOWN.
Jan 5 10:56:54 daemon crit kernel: eth0 Link UP 100 mbps full duplex
Jan 5 10:56:54 daemon crit kernel: eth0 Link DOWN.
Jan 5 10:56:54 daemon crit kernel: eth0 Link UP 100 mbps full duplex
Jan 5 10:56:54 daemon crit kernel: eth0 Link DOWN.

(only using it as an AP so wouldn't expect any firewall entries)
rongtw
Seasoned Hero
Posts: 6,973
Thanks: 1,540
Fixes: 12
Registered: ‎01-12-2010

Re: Unlocking the potential of Sagemcom 2704N

As a matter of interest How come PN dont release an update for the router ?? with this added
Asus ROG Hero Vii Z97 , Intel i5 4690k ,ROG Asus Strix 1070,
samsung 850evo 250gig , WD black 2 TB . Asus Phoebus sound ,
16 gig Avexir ram 2400 , water cooling Corsair H100i gtx ,
Corsair 750HXI Psu , Phanteks Enthoo pro case .
Matty123123
Grafter
Posts: 96
Thanks: 2
Registered: ‎01-04-2015

Re: Unlocking the potential of Sagemcom 2704N

Righty...  After trying many little programs on the net, this appears to be the only working solution (to combine configs):
http://stackoverflow.com/questions/14878706/merge-xml-files-with-nested-elements-without-external-li...
As its using Python, it has the possibility to work across all OSes.
Copy-n-Paste it into e.g. combiner.py    (ignoring the line print '-'*20 at the bottom)

So, assuming your main-text-config is "sample1.xml"
and this is "sample2.xml"
[code=sample2.xml]<DslCpeConfig version="3.0">
<InternetGatewayDevice>
<X_BROADCOM_COM_AppCfg>
<SshdCfg>
  <NetworkAccess>LAN</NetworkAccess>
</SshdCfg>
</X_BROADCOM_COM_AppCfg>
<SshControl>
<Enable>TRUE</Enable>
<UserName>username-here</UserName>
<Password>password-here</Password>
</SshControl>
<X_BROADCOM_COM_SyslogCfg>
 <Status>Enabled</Status>
 <Option>local buffer</Option>
 <LocalDisplayLevel>Error</LocalDisplayLevel>
 <LocalLogLevel>Debug</LocalLogLevel>
</X_BROADCOM_COM_SyslogCfg>
</InternetGatewayDevice>
</DslCpeConfig>
[/code]
$ python combiner.py > new-config.conf

This method requires a full hierarchical tree defined.  In a previous post I purposely omitted the <DslCpeConfig version="3.0"> and <InternetGatewayDevice> which I should not have done that ! sorry.
I thought it would be easy to find a quick program  Smiley  I tried about a dozen "XML Mergers" and none of them worked correctly !  wow

EDIT:
Thanks to 11110_110, he pointed out that this line:
"<?xml version="1.0"?>"
Is missing fromt he top of the config. So you need to add it manually or add it as a print option in the python script.
Cheers.
Matty123123
Grafter
Posts: 96
Thanks: 2
Registered: ‎01-04-2015

Re: Unlocking the potential of Sagemcom 2704N

Quote from: rongtw
As a matter of interest How come PN dont release an update for the router ?? with this added

I think thats a good question, I'll try to give a reason why ""I think"" they have not...
The software started out as a full software (with dect/phone option).  How-ever I can see they have really cut down to save power.  But they have also cut down on the amount of Flash & RAM it has, because of some managment guy.
Everyone like the idea of firewall this-n-that.  But in theory they dont need to add it in, because of the firewall option when you log-into your account (which has its own issues)
so, they removed that part of the config - so they can reduce the space used.  By this act alone, it will cut down the config size.
If you have a look at the stock firmware, where the menu items are in http://192.168.1.254/menuBcm.js ; guys called guxr,chengjianwei,Chen,Manju have marked lots of options as 'bugs' which are blocking menu options.  The bugs are numbered, but the numbers appear to be referencing an internal ticketing system, but I believe has nothing to do with plusnet.?
Once a bug, its probably not going to go back!, because there is always another customer to have a problem of "Deleting the WAN interface" and demanding its plusnets fault.
Also I think they have disabled the serial port interface.... because when the aDSL is active. the responce time is soo slow it is really struggling to keep up with any command you type.
They have possibly another bug with the compressing of the config correctly. So removing more options keeps it down.  The change I made to get round this works fine.  But its not technically by-there-book.  (My book is fine)

Ooooh, that felt good saying that    Smiley