Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > Your Distro > Other Distributions > iptables issue

Forgot Password?
 Other Distributions   Post questions about distributions that do not have their own forums in here

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 06-02-2009   #1 (permalink)
Just Joined!
 
Join Date: Mar 2007
Posts: 16
iptables issue

Hello,

I am using montavista embedded linux 2.6 and I am trying to do the following:

*) connect a loopback cable to the ethernet port
*) set iptables nat rules to force the packets to go out of the ethernet layer
*) after this when I ping the local ip address, it pings fine with full duplex connection, but not with half duplex connection. Following has more details: It would be great if someone would help:

####### full duplex #########################

# /usr/local/bin/ethtool eth0
Settings for eth0:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: external
Auto-negotiation: on
Link detected: yes

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0D:00:ff:01:ee
inet addr:192.168.1.2 Bcast:192.168.159.255 Mask:255.255.224.0
inet6 addr: fe80::20a:ff:fe98:17d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:156 (156.0 B) TX bytes:426 (426.0 B)
Interrupt:23

# iptables -t nat -A OUTPUT -d 192.168.1.2 -j DNAT --to-destination 192.168.1.10
# iptables -t nat -A POSTROUTING -s 192.168.1.2 -j SNAT --to-source 192.168.1.10
# iptables -t nat -A PREROUTING -d 192.168.1.10 -j DNAT --to-destination 192.168.1.2
# /usr/local/bin/arp -s 192.168.1.10 00:0D:00:ff:01:ee

# /usr/local/bin/ethtool -s eth0 autoneg off
# <6>eth0: link is up, 100 FDX

# /usr/local/bin/miitool eth0
link status: up, auto negotiate: disabled, link speed: 100 Mbps, link duplex: full

# ping 192.168.1.2
PING 192.168.136.NAT: no longer support implicit source local NAT
33 (NAT: packet src 192.168.1.10 -> dst 192.168.1.2
3): 56 data bytes
64 bytes from 192.168.1.2: seq=0 ttl=64 time=141.649 ms
64 bytes from 192.168.1.2: seq=2 ttl=64 time=1.148 ms

######################### half duplex #################

# /usr/local/bin/ethtool -s eth0 duplex half
# <6>eth0: link is up, 100 HDX

# /usr/local/bin/miitool eth0
link status: up, auto negotiate: disabled, link speed: 100 Mbps, link duplex: half

# ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2): 56 data bytes

--- 192.168.1.2 ping statistics ---
9 packets transmitted, 0 packets received, 100% packet loss


######################## back to full duplex ############

# /usr/local/bin/ethtool -s eth0 duplex full
# <6>eth0: link is up, 100 FDX

# /usr/local/bin/miitool eth0
link status: up, auto negotiate: disabled, link speed: 100 Mbps, link duplex: full

# ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2): 56 data bytes
64 bytes from 192.168.1.2: seq=0 ttl=64 time=1.559 ms
64 bytes from 192.168.1.2: seq=1 ttl=64 time=1.200 ms

--- 192.168.1.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 1.200/1.379/1.559 ms
#
######### end ######
ganeshragavan is offline  



Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 05:30 PM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1