This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

NAT-IP help

Old posts that have not been replied to for several years.
Locked
m
mort3n
Voice
Posts: 8
Joined: Mon Dec 06, 2004 9:11 pm

NAT-IP help

Post by mort3n »

I have a ISP that gives me a dynamic IP. I have set the NAT-IP in the eggdrop.conf, but i wonder if there is a script or some way that i can changse this automaticly??
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

use this:

Code: Select all

proc get-nat-ip {} {
  set f [open "|/sbin/ifconfig -a"]
  while {![eof $f]} {lappend x [gets $f]}
  close $f
  foreach line $x {
    if [string match "*inet *" $line] {
      set ip [lindex [split [string trim $line]] 1]
      if [string match 127.0.0.* $ip] continue
      if [string match 192.168.* $ip] continue
      return $ip
    }
  }
} 
(may need tweaking for your ifconfig)
m
mort3n
Voice
Posts: 8
Joined: Mon Dec 06, 2004 9:11 pm

Post by mort3n »

uhm.. but i'm kind a noobie on this, so i don't know how i use that... can you help me out please ?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

set nat-ip [get-nat-ip]
m
mort3n
Voice
Posts: 8
Joined: Mon Dec 06, 2004 9:11 pm

Post by mort3n »

That i understand, but where do i write it and stuff like that ?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

in your config

or, if you wish, put it in a dedicated script and source that script in the config
m
mort3n
Voice
Posts: 8
Joined: Mon Dec 06, 2004 9:11 pm

Post by mort3n »

okay.. i tried both tings, as a seperate script and sourced to it, and as the first thing in my config-file. The bot starts like normal and links up, but when it sends the userfile, it wont work
[16:19] Telnet connection: 2mmy.pointclark.net/4525
[16:20] Challenging s0tt0s...
[16:20] Linked to s0tt0s.
*** Linked to s0tt0s
[16:20] Creating resync buffer for s0tt0s
[16:20] Sending user file send request to s0tt0s
[16:20] Ending sharing with s0tt0s (Can't connect to you!).
[16:20] (Userlist transmit aborted.)
[16:20] Lost bot: s0tt0s (lost 1 bot and 0 users).
*** Lost bot: s0tt0s (lost 1 bot and 0 users)
it doesn't seem like the script work right.. what could be wrong ? It's the same if i have it like a seperate script or in the config-file..
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

it might be that the script's not working correctly - that's why I already said it may need tweaking for your ifconfig - check that by issuing the `ifconfig -a' command in your shell

and it might be that script's working perfectly and you have other problems - firewall, closed ports. etc.
m
mort3n
Voice
Posts: 8
Joined: Mon Dec 06, 2004 9:11 pm

Post by mort3n »

i've tried to to config it myself, but i don't know how to do it..

But it has to be the script that's the problem, because if i write my ip manually, it all works fine..
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

paste the result of `ifconfig -a'!
m
mort3n
Voice
Posts: 8
Joined: Mon Dec 06, 2004 9:11 pm

Post by mort3n »

[s0tnos@s0tnos s0tnos]$ /sbin/ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:02:B3:9E:B5:04
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18006421 errors:5 dropped:0 overruns:0 frame:5
TX packets:16971362 errors:45 dropped:0 overruns:0 carrier:45
collisions:20737 txqueuelen:100
RX bytes:2859060663 (2726.6 Mb) TX bytes:3390224294 (3233.1 Mb)
Interrupt:11 Base address:0xd800 Memory:dffff000-dffff038

eth1 Link encap:Ethernet HWaddr 00:04:75:FB:46:D9
inet addr:192.168.123.1 Bcast:192.168.123.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5788301 errors:0 dropped:0 overruns:0 frame:0
TX packets:6006514 errors:0 dropped:0 overruns:0 carrier:9049
collisions:0 txqueuelen:100
RX bytes:2931630945 (2795.8 Mb) TX bytes:4254833775 (4057.7 Mb)
Interrupt:12 Base address:0xd400

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:263388 errors:0 dropped:0 overruns:0 frame:0
TX packets:263388 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:25192007 (24.0 Mb) TX bytes:25192007 (24.0 Mb)

ppp0 Link encap:Point-to-Point Protocol
inet addr:83.109.30.87 P-t-P:83.109.0.0 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:167860 errors:0 dropped:0 overruns:0 frame:0
TX packets:93784 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:130976998 (124.9 Mb) TX bytes:5465812 (5.2 Mb)
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

I told you it may need a tweak:

Code: Select all

proc get-nat-ip {} {
  set f [open "|/sbin/ifconfig -a"]
  while {![eof $f]} {lappend x [gets $f]}
  close $f
  foreach line $x {
    if [string match "*inet *" $line] {
      set ip [lindex [split [string trim $line]] 1]
      set ip [lindex [split $ip :] 1]
      if [string match 127.0.0.* $ip] continue
      if [string match 192.168.* $ip] continue
      return $ip
    }
  }
} 
let me know if this works
m
mort3n
Voice
Posts: 8
Joined: Mon Dec 06, 2004 9:11 pm

Post by mort3n »

yes!! it worked :D

Thanks man ;)
Locked