Jump to content

Linux programming (maybe bash), duplicate windows output for a Linux program


Recommended Posts

Posted

Here's a little coding fun...duplicate the output from a windows program for Linux...

 

---background

My Internet randomly gets really slow and stays that way, usually until I reset the modem. For instance, 5 minuets ago before I started writing this, it was 262 K. I just noticed that it sped up because scienceforums loaded normal, at 3042 Kb...

 

I've called customer support, a couple times, but most of the people keep saying "we don't support Linux" and just stop at that. Two people went through and tested my downstreamSNR, transmit power, and were pretty useful. One had me do a complete modem reset, informed me that a lot of customers fix this by getting the latest modem, etc, but the rest just say "that exe file doesn't run on Linux" and refuse to do anything else -- it's company policy, I guess, to receive the output. Like they just dont feel like even trying because they have an excuse to not help. I do have a Windows computer, unfortunately it's really screwed up right now (after installing macafee -- this is why I run Linux...) but I did run it once. It outputted a bunch of pings, etc...what I want to do is write a program that does the same thing on Linux. I'm trying bash because it seems pretty easy. I've never programmed bash.

 

It would be something like

 

!#bin/whatever....I already forget how to start the program

 

ping yahoo.com -c 4

tracerought 68-117-144-001.dhcp.chtn.wv.charter.com

netstat -a

 

etc

 

It seems pretty easy to do. However there are a couple of things that are throwing me off. Like,

Tracing route to XP-686 [68.117.159.247]
over a maximum of 30 hops:

 1    <1 ms    <1 ms    <1 ms  XP-686
[68.117.159.247] 

Trace complete.

Would this be tracerought localhost? Also, when the program finished, it told me "give tech this number:

68.117.159.247

 

and send in the diagnostics.txt"

 

I have no idea what 68.117.159.247 is. I dont think it's my IP address...but it shows up a few times in the diagnostics. Any ideas?

 

 

 

Anybody that wants to do this, go ahead.

 

Here's the output:

Pinging 68.117.159.247 with 32 bytes of data:

 

Reply from 68.117.159.247: bytes=32 time<1ms TTL=128

Reply from 68.117.159.247: bytes=32 time<1ms TTL=128

Reply from 68.117.159.247: bytes=32 time<1ms TTL=128

Reply from 68.117.159.247: bytes=32 time<1ms TTL=128

 

Ping statistics for 68.117.159.247:

Packets: Sent = 4, Received = 4, Lost = 0 (0%

loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 0ms, Average = 0ms

 

 

Tracing route to XP-686 [68.117.159.247]

over a maximum of 30 hops:

 

1 <1 ms <1 ms <1 ms XP-686

[68.117.159.247]

 

Trace complete.

 

 

Pinging 68.117.144.1 with 32 bytes of data:

 

Reply from 68.117.144.1: bytes=32 time=6ms TTL=254

Reply from 68.117.144.1: bytes=32 time=7ms TTL=254

Reply from 68.117.144.1: bytes=32 time=9ms TTL=254

Reply from 68.117.144.1: bytes=32 time=6ms TTL=254

 

Ping statistics for 68.117.144.1:

Packets: Sent = 4, Received = 4, Lost = 0 (0%

loss),

Approximate round trip times in milli-seconds:

Minimum = 6ms, Maximum = 9ms, Average = 7ms

 

 

Tracing route to

68-117-144-001.dhcp.chtn.wv.charter.com [68.117.144.1]

over a maximum of 30 hops:

 

1 8 ms 10 ms 11 ms

68-117-144-001.dhcp.chtn.wv.charter.com [68.117.144.1]

 

 

Trace complete.

 

 

Pinging 68.114.38.210 with 32 bytes of data:

 

Reply from 68.114.38.210: bytes=32 time=7ms TTL=252

Reply from 68.114.38.210: bytes=32 time=7ms TTL=252

Reply from 68.114.38.210: bytes=32 time=12ms TTL=252

Reply from 68.114.38.210: bytes=32 time=8ms TTL=252

 

Ping statistics for 68.114.38.210:

Packets: Sent = 4, Received = 4, Lost = 0 (0%

loss),

Approximate round trip times in milli-seconds:

Minimum = 7ms, Maximum = 12ms, Average = 8ms

 

 

Tracing route to 68.114.38.210 over a maximum of 30

hops

 

1 7 ms 8 ms 7 ms 10.150.0.1

2 7 ms 7 ms 7 ms 172.23.35.1

3 11 ms 8 ms 12 ms 172.23.33.35

4 7 ms 7 ms 12 ms 68.114.38.210

 

Trace complete.

 

 

Pinging 24.158.85.2 with 32 bytes of data:

 

Reply from 24.158.85.2: bytes=32 time=7ms TTL=61

Reply from 24.158.85.2: bytes=32 time=7ms TTL=61

Reply from 24.158.85.2: bytes=32 time=10ms TTL=61

Reply from 24.158.85.2: bytes=32 time=8ms TTL=61

 

Ping statistics for 24.158.85.2:

Packets: Sent = 4, Received = 4, Lost = 0 (0%

loss),

Approximate round trip times in milli-seconds:

Minimum = 7ms, Maximum = 10ms, Average = 8ms

 

 

Tracing route to

24-158-85-002.static.chtr.wv.charter.com [24.158.85.2]

over a maximum of 30 hops:

 

1 7 ms 16 ms 7 ms 10.150.0.1

2 26 ms 10 ms 15 ms 172.23.35.1

3 8 ms 15 ms 12 ms 172.23.33.35

4 14 ms 11 ms 11 ms

24-158-85-002.static.chtr.wv.charter.com [24.158.85.2]

 

 

Trace complete.

 

 

Pinging 24.158.85.3 with 32 bytes of data:

 

Reply from 24.158.85.3: bytes=32 time=7ms TTL=61

Reply from 24.158.85.3: bytes=32 time=7ms TTL=61

Reply from 24.158.85.3: bytes=32 time=7ms TTL=61

Reply from 24.158.85.3: bytes=32 time=7ms TTL=61

 

Ping statistics for 24.158.85.3:

Packets: Sent = 4, Received = 4, Lost = 0 (0%

loss),

Approximate round trip times in milli-seconds:

Minimum = 7ms, Maximum = 7ms, Average = 7ms

 

 

Tracing route to

24-158-85-003.static.chtr.wv.charter.com [24.158.85.3]

over a maximum of 30 hops:

 

1 14 ms 6 ms 6 ms 10.150.0.1

2 7 ms 6 ms 17 ms 172.23.35.1

3 14 ms 13 ms 7 ms 172.23.33.35

4 9 ms 11 ms 11 ms

24-158-85-003.static.chtr.wv.charter.com [24.158.85.3]

 

 

Trace complete.

 

 

Pinging 127.0.0.1 with 32 bytes of data:

 

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

 

Ping statistics for 127.0.0.1:

Packets: Sent = 4, Received = 4, Lost = 0 (0%

loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 0ms, Average = 0ms

 

 

Tracing route to localhost [127.0.0.1]

over a maximum of 30 hops:

 

1 <1 ms <1 ms <1 ms localhost [127.0.0.1]

 

Trace complete.

 

 

Pinging http://www.yahoo.akadns.net [68.142.226.54] with 32

bytes of data:

 

Reply from 68.142.226.54: bytes=32 time=68ms TTL=54

Reply from 68.142.226.54: bytes=32 time=67ms TTL=54

Reply from 68.142.226.54: bytes=32 time=57ms TTL=54

Reply from 68.142.226.54: bytes=32 time=49ms TTL=54

 

Ping statistics for 68.142.226.54:

Packets: Sent = 4, Received = 4, Lost = 0 (0%

loss),

Approximate round trip times in milli-seconds:

Minimum = 49ms, Maximum = 68ms, Average = 60ms

 

 

Tracing route to http://www.yahoo.akadns.net [68.142.226.54]

over a maximum of 30 hops:

 

1 11 ms 10 ms 9 ms 10.150.0.1

2 25 ms 11 ms 18 ms 172.23.35.1

3 13 ms 9 ms 7 ms 172.23.33.33

4 22 ms 25 ms 22 ms 12.119.93.37

5 36 ms 32 ms 33 ms

tbr2-p013102.wswdc.ip.att.net [12.122.3.62]

6 30 ms 32 ms 35 ms

gar1-p390.ascva.ip.att.net [12.123.8.53]

7 * * * Request timed out.

8 64 ms 45 ms 43 ms

vlan240-msr1.re1.yahoo.com [216.115.96.169]

9 51 ms 40 ms 49 ms

t-2-1.bas1.re2.yahoo.com [206.190.33.89]

10 45 ms 45 ms 46 ms p23.http://www.re2.yahoo.com

[68.142.226.54]

 

Trace complete.

 

 

Pinging metalab.unc.edu [152.2.210.80] with 32 bytes

of data:

 

Reply from 152.2.210.80: bytes=32 time=83ms TTL=50

Reply from 152.2.210.80: bytes=32 time=85ms TTL=50

Reply from 152.2.210.80: bytes=32 time=79ms TTL=50

Reply from 152.2.210.80: bytes=32 time=113ms TTL=50

 

Ping statistics for 152.2.210.80:

Packets: Sent = 4, Received = 4, Lost = 0 (0%

loss),

Approximate round trip times in milli-seconds:

Minimum = 79ms, Maximum = 113ms, Average = 90ms

 

 

Tracing route to metalab.unc.edu [152.2.210.80]

over a maximum of 30 hops:

 

1 13 ms 8 ms 12 ms 10.150.0.1

2 25 ms 11 ms 16 ms 172.23.35.1

3 12 ms 15 ms 12 ms 172.23.33.33

4 30 ms 24 ms 28 ms 12.119.93.53

5 35 ms 35 ms 34 ms

tbr2-p013102.wswdc.ip.att.net [12.122.3.62]

6 33 ms 30 ms 40 ms

ggr2-p390.wswdc.ip.att.net [12.123.9.85]

7 37 ms 38 ms 38 ms 4.68.127.153

8 61 ms 53 ms 53 ms

ae-2-54.bbr2.Washington1.Level3.net [4.68.121.97]

9 56 ms 56 ms 55 ms

so-1-0-0.mpls2.Raleigh1.Level3.net [209.247.11.86]

10 51 ms 50 ms 46 ms

so-10-0.hsa2.Raleigh1.Level3.net [4.68.114.230]

11 48 ms 49 ms 51 ms unknown.Level3.net

[64.158.228.2]

12 72 ms 75 ms 67 ms

rtp7600-gw-to-rtp1-gw.ncren.net [128.109.70.54]

13 51 ms 51 ms 49 ms

unc7600-gw-to-rtp7600-gw.ncren.net [128.109.70.34]

14 60 ms 59 ms 61 ms 128.109.70.70

15 73 ms 78 ms 79 ms http://www.ibiblio.org

[152.2.210.80]

 

Trace complete.

 

 

 

Windows IP Configuration

 

 

 

Host Name . . . . . . . . . . . . : XP-686

 

Primary Dns Suffix . . . . . . . :

 

Node Type . . . . . . . . . . . . : Unknown

 

IP Routing Enabled. . . . . . . . : No

 

WINS Proxy Enabled. . . . . . . . : No

 

 

 

Ethernet adapter Local Area Connection:

 

 

 

Connection-specific DNS Suffix . :

 

Description . . . . . . . . . . . : Realtek

RTL8139/810X Family PCI Fast Ethernet NIC

 

Physical Address. . . . . . . . . :

00-40-2B-6F-75-48

 

Dhcp Enabled. . . . . . . . . . . : Yes

 

Autoconfiguration Enabled . . . . : Yes

 

IP Address. . . . . . . . . . . . :

68.117.159.247

 

Subnet Mask . . . . . . . . . . . :

255.255.240.0

 

Default Gateway . . . . . . . . . :

68.117.144.1

 

DHCP Server . . . . . . . . . . . :

68.114.38.210

 

DNS Servers . . . . . . . . . . . :

24.158.85.2

 

 

24.158.85.3

 

Lease Obtained. . . . . . . . . . : Thursday,

October 13, 2005 6:56:14 PM

 

Lease Expires . . . . . . . . . . : Friday,

October 14, 2005 2:56:14 AM

 

 

Active Connections

 

Proto Local Address Foreign Address

State

TCP 0.0.0.0:135 0.0.0.0:0

LISTENING

TCP 0.0.0.0:445 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1025 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1033 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1037 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1038 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1047 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1048 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1125 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1819 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1903 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1974 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1981 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1983 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1984 0.0.0.0:0

LISTENING

TCP 0.0.0.0:1985 0.0.0.0:0

LISTENING

TCP 0.0.0.0:5000 0.0.0.0:0

LISTENING

TCP 68.117.159.247:139 0.0.0.0:0

LISTENING

TCP 68.117.159.247:1819 66.220.17.169:80

ESTABLISHED

TCP 68.117.159.247:1903 12.120.9.15:80

ESTABLISHED

TCP 68.117.159.247:1942 12.130.60.3:80

TIME_WAIT

TCP 68.117.159.247:1944 68.142.228.136:80

TIME_WAIT

TCP 68.117.159.247:1952 64.215.169.216:80

TIME_WAIT

TCP 68.117.159.247:1974 205.180.86.14:80

ESTABLISHED

TCP 68.117.159.247:1981 64.215.169.217:80

ESTABLISHED

TCP 68.117.159.247:1983 64.215.169.217:80

ESTABLISHED

TCP 68.117.159.247:1984 64.215.169.216:80

ESTABLISHED

TCP 68.117.159.247:1985 64.215.169.216:80

ESTABLISHED

TCP 68.117.159.247:1986 68.142.228.136:80

TIME_WAIT

TCP 68.117.159.247:1989 68.142.228.136:80

TIME_WAIT

TCP 68.117.159.247:7406 0.0.0.0:0

LISTENING

TCP 127.0.0.1:1049 0.0.0.0:0

LISTENING

TCP 127.0.0.1:1124 0.0.0.0:0

LISTENING

TCP 127.0.0.1:1124 127.0.0.1:1125

ESTABLISHED

TCP 127.0.0.1:1125 127.0.0.1:1124

ESTABLISHED

UDP 0.0.0.0:445 *:*

 

UDP 0.0.0.0:500 *:*

 

UDP 0.0.0.0:1034 *:*

 

UDP 0.0.0.0:1035 *:*

 

UDP 0.0.0.0:1053 *:*

 

UDP 0.0.0.0:1060 *:*

 

UDP 0.0.0.0:1700 *:*

 

UDP 68.117.159.247:123 *:*

 

UDP 68.117.159.247:137 *:*

 

UDP 68.117.159.247:138 *:*

 

UDP 68.117.159.247:1900 *:*

 

UDP 68.117.159.247:4478 *:*

 

UDP 68.117.159.247:15165 *:*

 

UDP 127.0.0.1:123 *:*

 

UDP 127.0.0.1:1041 *:*

 

UDP 127.0.0.1:1100 *:*

 

UDP 127.0.0.1:1744 *:*

 

UDP 127.0.0.1:1900 *:*

(ps - this is computer science, not necessarily help)

 

edit:here's what I have. I'm confused about these numbers. The very first ping is 68.117.159.247 which corosponds to "IP Address" in windows Ip config. It pings/traces 24.158.85.2 which is "DNS Servers." How do I find these numbers?

 

Also, what netstat option should I use and how do I output the equivilent of (I think) ipconfig? Here's what I think it should be

#!/bin/bash 
ping "IP ADDRESS" -c 4
traceroute "IP ADDRESS"
ping "IP ADDRESS" -c 4
traceroute ...
ping "DHCP SERVER" -c 4
traceroute "DHCP SERVER"
traceroute "DHCP SERVER" -m 30
ping "DNS SERVER" -c 4
traceroute "DNS SERVER" -m 30
ping "DNS SERVER-2" -c 4
traceroute "DNS SERVER-2" -m 30
ping 127.0.0.1 -c 4
traceroute localhost -m 30
ping www.yahoo.akadns.net -c 4
traceroute www.yahoo.akadns.net -m 30
ping metalab.unc.edu -c 4
traceroute metalab.unc.edu -m 30
ip configurations
netstat -something

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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.