Modifying IPv4 headers


 
Thread Tools Search this Thread
Special Forums IP Networking Modifying IPv4 headers
# 1  
Old 12-25-2009
Question Modifying IPv4 headers

Hi,

My query is:
I need to set the IPv4 header fields(like TOS, TTL, Precedence and Flags) in the linux kernel using the system calls.
I tried setting the fields using the setsockopt() call using sockets but it is not reflecting the actual IPv4 header fields. Is it possible to modify these fields? Please let me know the way of setting IPv4 header fields using the system calls.

Also, I can set the TTL field using /proc interface - /proc/sys/net/ipv4/ip_default_ttl. Anyone knows how to set for other header fields?

I tried googling but I couldn't find it. Please help me.

Thanks in advance,
Kiran.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Disable IPV4

Hi im using Redhat Ver 6.4 is it possible to disable IPV4 and use only IPV6? how can i do that? thanks Guy (2 Replies)
Discussion started by: guy3145
2 Replies

2. Solaris

Ntp between ipv4 and ipv6

Hi, I am looking for a solution to configure ntp between ipv4 ( ntp server ) to ipv6 ( client) . I had google, but lot many sites suggest to have dual stock or tunnaling. my issue is I have client has only ipv6 address ans server has ipv4 address. is it possible to sync time,... (4 Replies)
Discussion started by: naveen.surisett
4 Replies

3. Programming

IPv4 string->int

Does anyone know how to convert a IP address given as 'string' into a 'u_int32_t'? Are there any build any functions already? (1 Reply)
Discussion started by: Freaky123
1 Replies

4. AIX

IPv6/IPv4 Only in AIX

Hi all, I have setup ipv6 in AIX machine using autoconf6 command. I was successfull in doing this. after execution of the command local link address was assigned to one of the interfaces (en1).But I have to setup the following environment as well. 1) Machine with only IPv6 support(IPv4... (0 Replies)
Discussion started by: ard
0 Replies

5. UNIX for Dummies Questions & Answers

Modifying headers

I have a FASTA file with thousands of sequences that looks something like this: I need to modfy the header in such way that everything after the dot is remove. Thus, I will end up with something like this: Thanks (1 Reply)
Discussion started by: Xterra
1 Replies

6. Shell Programming and Scripting

Merging of files with different headers to make combined headers file

Hi , I have a typical situation. I have 4 files and with different headers (number of headers is varible ). I need to make such a merged file which will have headers combined from all files (comman coluns should appear once only). For example - File 1 H1|H2|H3|H4 11|12|13|14 21|22|23|23... (1 Reply)
Discussion started by: marut_ashu
1 Replies

7. Shell Programming and Scripting

Remove text between headers while leaving headers intact

Hi, I'm trying to strip all lines between two headers in a file: ### BEGIN ### Text to remove, contains all kinds of characters ... Antispyware-Downloadserver.com (Germany)=http://www.antispyware-downloadserver.c om/updates/ Antispyware-Downloadserver.com #2... (3 Replies)
Discussion started by: Trones
3 Replies

8. AIX

convert ipv4 ti ipv6

hello i'm working on AIX 5300-05-03 P520 hacmp 5.4 when connection to the internet is going down , firewall down, my application work verey verey slowly!!! and on the sliffer output i'm got trys of my serevr to do convert from ipv4 ipv6 ( 0.0.2.0 and AAAAAAAA). some one have an idea why... (1 Reply)
Discussion started by: ariec
1 Replies

9. UNIX for Advanced & Expert Users

convert from ipv4 to ipv6

hello i'm working on aix 5300-05-03 hacmp ver 5.4 well my issue is that when firewall (gateway to internet ) goes down my machine start to work very very slowly!!! the output of the sniffer is that on the output card , my machine try to convert ipv4 to ipv6 0.0.2.0 my machine is not configure... (1 Reply)
Discussion started by: ariec
1 Replies

10. Programming

IPv4 LSRR Option

Hello Friends, I have one doubt regarding LSRR (Loose Source and Record Route) IP option. Whether IPv4 optoins will be processed only by Router or they can be processed by any PC within the network?? What i'm trying is: i'm giving a list of IP address in the option using setsockopt system call,... (1 Reply)
Discussion started by: aamirglb
1 Replies
Login or Register to Ask a Question
GIF(4)							   BSD Kernel Interfaces Manual 						    GIF(4)

NAME
gif -- generic tunnel interface SYNOPSIS
pseudo-device gif DESCRIPTION
The gif interface is a generic tunnelling pseudo device for IPv4 and IPv6. It can tunnel IPv[46] traffic over IPv[46]. Therefore, there can be four possible configurations. The behavior of gif is mainly based on RFC2893 IPv6-over-IPv4 configured tunnel. On NetBSD, gif can also tunnel ISO traffic over IPv[46] using EON encapsulation. Each gif interface is created at runtime using interface cloning. This is most easily done with the ifconfig(8) create command or using the gifconfig_<interface> variable in rc.conf(5). To use gif, administrator needs to configure protocol and addresses used for the outer header. This can be done by using gifconfig(8), or SIOCSIFPHYADDR ioctl. Also, administrator needs to configure protocol and addresses used for the inner header, by using ifconfig(8). Note that IPv6 link-local address (those start with fe80::) will be automatically configured whenever possible. You may need to remove IPv6 link- local address manually using ifconfig(8), when you would like to disable the use of IPv6 as inner header (like when you need pure IPv4-over- IPv6 tunnel). Finally, use routing table to route the packets toward gif interface. gif can be configured to be ECN friendly. This can be configured by IFF_LINK1. ECN friendly behavior gif can be configured to be ECN friendly, as described in draft-ietf-ipsec-ecn-02.txt. This is turned off by default, and can be turned on by IFF_LINK1 interface flag. Without IFF_LINK1, gif will show a normal behavior, like described in RFC2893. This can be summarized as follows: Ingress Set outer TOS bit to 0. Egress Drop outer TOS bit. With IFF_LINK1, gif will copy ECN bits (0x02 and 0x01 on IPv4 TOS byte or IPv6 traffic class byte) on egress and ingress, as follows: Ingress Copy TOS bits except for ECN CE (masked with 0xfe) from inner to outer. Set ECN CE bit to 0. Egress Use inner TOS bits with some change. If outer ECN CE bit is 1, enable ECN CE bit on the inner. Note that the ECN friendly behavior violates RFC2893. This should be used in mutual agreement with the peer. Security Malicious party may try to circumvent security filters by using tunnelled packets. For better protection, gif performs martian filter and ingress filter against outer source address, on egress. Note that martian/ingress filters are no way complete. You may want to secure your node by using packet filters. Ingress filter can be turned off by IFF_LINK2 bit. Miscellaneous By default, gif tunnels may not be nested. This behavior may be modified at runtime by setting the sysctl(8) variable net.link.gif.max_nesting to the desired level of nesting. Additionally, gif tunnels are restricted to one per pair of end points. Parallel tunnels may be enabled by setting the sysctl(8) variable net.link.gif.parallel_tunnels to 1. SEE ALSO
inet(4), inet6(4), gifconfig(8) R. Gilligan and E. Nordmark, "Transition Mechanisms for IPv6 Hosts and Routers", RFC2893, August 2000, ftp://ftp.isi.edu/in- notes/rfc2893.txt. Sally Floyd, David L. Black, and K. K. Ramakrishnan, IPsec Interactions with ECN, December 1999, draft-ietf-ipsec-ecn-02.txt. HISTORY
The gif device first appeared in WIDE hydrangea IPv6 kit. BUGS
There are many tunnelling protocol specifications, defined differently from each other. gif may not interoperate with peers which are based on different specifications, and are picky about outer header fields. For example, you cannot usually use gif to talk with IPsec devices that use IPsec tunnel mode. The current code does not check if the ingress address (outer source address) configured to gif makes sense. Make sure to configure an address which belongs to your node. Otherwise, your node will not be able to receive packets from the peer, and your node will generate packets with a spoofed source address. If the outer protocol is IPv4, gif does not try to perform path MTU discovery for the encapsulated packet (DF bit is set to 0). If the outer protocol is IPv6, path MTU discovery for encapsulated packet may affect communication over the interface. The first bigger- than-pmtu packet may be lost. To avoid the problem, you may want to set the interface MTU for gif to 1240 or smaller, when outer header is IPv6 and inner header is IPv4. gif does not translate ICMP messages for outer header into inner header. In the past, gif had a multi-destination behavior, configurable via IFF_LINK0 flag. The behavior was obsoleted and is no longer supported. It is thought that this is not actually a bug in gif, but rather lies somewhere around a manipulation of an IPv6 routing table. BSD
April 10, 1999 BSD