Jump to content

Linux ARM Support, & help with iptables?


Drathian

Recommended Posts

Make a very long story short I'm terrible with iptables and port forwarding, however I had the odd idea at the time to run mtsa off of my router directly. My router isn't the normal mips routers, it is built in arm, via a chroot trick I can run the arm version of debian linux (no graphics unless i vnc) on it. As I predicted the linux executible built for either x86 or x86_64 did not work. Being that i didn't know how complicated the internals of this server was I thought maybe I could run it via a bin_fmt or directly using qemu-i386. Unfortunatly, it almost worked, I ran this 'qemu-i386 mta-server' , [i can run programs without ./ because of have (PATH=$PATH:. export path)] and I got an error about missing syscall 240. I was able to fix that after a lot of headache, and recompiling a custom version of qemu user mode with ntpl support (it supposedly could run a handful of windows program with wine.) After recompling qemu-user on my router via debian (which is convoluted I know) I got past the 240 error just to be hit with a 318. I have no idea what that syscall is, 240 had something to do with mulithreading, I thought perhaps I had hit the end of the line, but then i ran a killall on 'qemu-i386 mta-server', and for a brief few seconds the server commands (console) displayed, then the program closed. I'm thinking that this might be more of an uphill battle then I can succeed at. I want your thoughts on it. Although it would be cool to have a mta-server compatible with arm, which in turn would make it available enough for android users to pick up, is that a good idea? I mean people running mta-servers off their phones might not be a good idea, dunno, funny tho lol. A course a multitheftauto client of android gta-sa/or vice city would kick ass.

So this leaves me with one more thing i can try to get my server running. If any of you have any experience with iptables, would you mind having a look at my iptable rule, and tell me what I'm doing wrong. It worked on my other router (which died), only difference is when i port forward via the gui it creates a rule in an additional nat table that doesn't exist on my other router called WANPREROUTING, so i dunno how to adjust the code. So please if you can help let me know.

Just so you know my network internally is configured like this. 7.7.7.7 is the router, 7.7.7.15 is the computer I run mta-server from. My internal network is a 7.7.7.0/25 or 7.7.7.0/255.255.255.128, if I could figure out the iptables problem, then I could for now give up on the probably more uphill battle on getting the mta-server running on arm linux. Thanks for reading.

-Drathian

  
wanf=`nvram get wan_ipaddr` 
lanf=`nvram get lan_ipaddr` 
  
#------- MTA San Andreas Access ----- 
iptables -I INPUT -p udp --dport 22003 -d 7.7.7.15 -m state --state NEW -m limit --limit 3/s --limit-burst 5 -j ACCEPT 
iptables -t nat -I PREROUTING -p udp --dport 22003 -d $wanf -j DNAT --to-destination 7.7.7.15:22003 
iptables -t nat -I POSTROUTING -d 7.7.7.15 -s 7.7.7.0/25 -p udp --dport 22003 -j SNAT --to-source $wanf:22003 
iptables -I INPUT -p tcp --dport 22005 -d 7.7.7.15 -m state --state NEW -m limit --limit 3/s --limit-burst 5 -j ACCEPT 
iptables -t nat -I PREROUTING -p tcp --dport 22005 -d $wanf -j DNAT --to-destination 7.7.7.15:22005 
iptables -t nat -I POSTROUTING -d 7.7.7.15 -s 7.7.7.0/25 -p tcp --dport 22005 -j SNAT --to-source $wanf:22005 
iptables -I INPUT -p udp --dport 22126 -d 7.7.7.15 -m state --state NEW -m limit --limit 3/s --limit-burst 5 -j ACCEPT 
iptables -t nat -I PREROUTING -p udp --dport 22126 -d $wanf -j DNAT --to-destination 7.7.7.15:22126 
iptables -t nat -I POSTROUTING -d 7.7.7.15 -s 7.7.7.0/25 -p udp --dport 22126 -j SNAT --to-source $wanf:22126 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...